home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / DTS Sample Code / Macintosh Sample Code / Monthly Releases (Compressed) / MacDTS.Sample.Code.89.06.sit / SC.002.TESample / TESample.p < prev    next >
MacBinary  |  1989-06-01  |  51.4 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert ZX81 Sinclair BASIC (image/sinclairBASIC) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Thu Jun 1 15:57:05 1989, modified Thu Jun 1 15:57:05 1989, creator 'MPS ', type ASCII, 51975 bytes "TESample.p" , at 0xcb87 382 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 54 45 53 61 6d 70 | 6c 65 2e 70 00 00 00 00 |..TESamp|le.p....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 00 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 cb 07 00 | 00 01 7e a0 ab 45 91 a0 |........|..~..E..|
|00000060| ab 45 91 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.E......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 9a f0 00 00 |........|........|
|00000080| 7b 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |{-------|--------|
|00000090| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0d |--------|-------.|
|000000d0| 23 0d 23 09 41 70 70 6c | 65 20 4d 61 63 69 6e 74 |#.#.Appl|e Macint|
|000000e0| 6f 73 68 20 44 65 76 65 | 6c 6f 70 65 72 20 54 65 |osh Deve|loper Te|
|000000f0| 63 68 6e 69 63 61 6c 20 | 53 75 70 70 6f 72 74 0d |chnical |Support.|
|00000100| 23 0d 23 09 4d 75 6c 74 | 69 46 69 6e 64 65 72 2d |#.#.Mult|iFinder-|
|00000110| 41 77 61 72 65 20 53 69 | 6d 70 6c 65 20 54 65 78 |Aware Si|mple Tex|
|00000120| 74 45 64 69 74 20 53 61 | 6d 70 6c 65 20 41 70 70 |tEdit Sa|mple App|
|00000130| 6c 69 63 61 74 69 6f 6e | 0d 23 0d 23 09 54 45 53 |lication|.#.#.TES|
|00000140| 61 6d 70 6c 65 0d 23 0d | 23 09 54 45 53 61 6d 70 |ample.#.|#.TESamp|
|00000150| 6c 65 2e 70 09 2d 09 50 | 61 73 63 61 6c 20 53 6f |le.p.-.P|ascal So|
|00000160| 75 72 63 65 0d 23 0d 23 | 09 43 6f 70 79 72 69 67 |urce.#.#|.Copyrig|
|00000170| 68 74 20 a9 20 31 39 38 | 39 20 41 70 70 6c 65 20 |ht . 198|9 Apple |
|00000180| 43 6f 6d 70 75 74 65 72 | 2c 20 49 6e 63 2e 0d 23 |Computer|, Inc..#|
|00000190| 09 41 6c 6c 20 72 69 67 | 68 74 73 20 72 65 73 65 |.All rig|hts rese|
|000001a0| 72 76 65 64 2e 0d 23 0d | 23 09 56 65 72 73 69 6f |rved..#.|#.Versio|
|000001b0| 6e 73 3a 09 0d 23 09 09 | 09 09 31 2e 30 30 09 09 |ns:..#..|..1.00..|
|000001c0| 09 09 30 38 2f 38 38 0d | 23 09 09 09 09 31 2e 30 |..08/88.|#....1.0|
|000001d0| 31 09 09 09 09 31 31 2f | 38 38 0d 23 09 09 09 09 |1....11/|88.#....|
|000001e0| 31 2e 30 32 09 09 09 09 | 30 34 2f 38 39 0d 23 09 |1.02....|04/89.#.|
|000001f0| 09 09 09 31 2e 30 33 09 | 09 09 09 30 36 2f 38 39 |...1.03.|...06/89|
|00000200| 0d 23 0d 23 09 43 6f 6d | 70 6f 6e 65 6e 74 73 3a |.#.#.Com|ponents:|
|00000210| 0d 23 09 09 09 09 54 45 | 53 61 6d 70 6c 65 2e 70 |.#....TE|Sample.p|
|00000220| 09 09 09 4a 75 6e 65 20 | 31 2c 20 31 39 38 39 0d |...June |1, 1989.|
|00000230| 23 09 09 09 09 54 45 53 | 61 6d 70 6c 65 2e 63 09 |#....TES|ample.c.|
|00000240| 09 09 4a 75 6e 65 20 31 | 2c 20 31 39 38 39 0d 23 |..June 1|, 1989.#|
|00000250| 09 09 09 09 54 45 53 61 | 6d 70 6c 65 47 6c 75 65 |....TESa|mpleGlue|
|00000260| 2e 61 09 09 4a 75 6e 65 | 20 31 2c 20 31 39 38 39 |.a..June| 1, 1989|
|00000270| 09 2d 4d 50 57 20 6f 6e | 6c 79 2d 0d 23 09 09 09 |.-MPW on|ly-.#...|
|00000280| 09 54 45 53 61 6d 70 6c | 65 2e 72 09 09 09 4a 75 |.TESampl|e.r...Ju|
|00000290| 6e 65 20 31 2c 20 31 39 | 38 39 0d 23 09 09 09 09 |ne 1, 19|89.#....|
|000002a0| 54 45 53 61 6d 70 6c 65 | 2e 68 09 09 09 4a 75 6e |TESample|.h...Jun|
|000002b0| 65 20 31 2c 20 31 39 38 | 39 0d 23 09 09 09 09 50 |e 1, 198|9.#....P|
|000002c0| 54 45 53 61 6d 70 6c 65 | 2e 6d 61 6b 65 09 09 4a |TESample|.make..J|
|000002d0| 75 6e 65 20 31 2c 20 31 | 39 38 39 09 2d 4d 50 57 |une 1, 1|989.-MPW|
|000002e0| 20 6f 6e 6c 79 2d 0d 23 | 09 09 09 09 43 54 45 53 | only-.#|....CTES|
|000002f0| 61 6d 70 6c 65 2e 6d 61 | 6b 65 09 09 4a 75 6e 65 |ample.ma|ke..June|
|00000300| 20 31 2c 20 31 39 38 39 | 09 2d 4d 50 57 20 6f 6e | 1, 1989|.-MPW on|
|00000310| 6c 79 2d 0d 23 09 09 09 | 09 54 45 53 61 6d 70 6c |ly-.#...|.TESampl|
|00000320| 65 47 6c 75 65 2e 73 09 | 09 4a 75 6e 65 20 31 2c |eGlue.s.|.June 1,|
|00000330| 20 31 39 38 39 09 2d 41 | 2f 55 58 20 6f 6e 6c 79 | 1989.-A|/UX only|
|00000340| 2d 0d 23 09 09 09 09 54 | 45 53 61 6d 70 6c 65 41 |-.#....T|ESampleA|
|00000350| 55 58 2e 72 09 09 4a 75 | 6e 65 20 31 2c 20 31 39 |UX.r..Ju|ne 1, 19|
|00000360| 38 39 09 2d 41 2f 55 58 | 20 6f 6e 6c 79 2d 0d 23 |89.-A/UX| only-.#|
|00000370| 09 09 09 09 4d 61 6b 65 | 66 69 6c 65 09 09 09 4a |....Make|file...J|
|00000380| 75 6e 65 20 31 2c 20 31 | 39 38 39 09 2d 41 2f 55 |une 1, 1|989.-A/U|
|00000390| 58 20 6f 6e 6c 79 2d 0d | 23 0d 23 09 54 45 53 61 |X only-.|#.#.TESa|
|000003a0| 6d 70 6c 65 20 69 73 20 | 61 6e 20 65 78 61 6d 70 |mple is |an examp|
|000003b0| 6c 65 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 74 |le appli|cation t|
|000003c0| 68 61 74 20 64 65 6d 6f | 6e 73 74 72 61 74 65 73 |hat demo|nstrates|
|000003d0| 20 68 6f 77 20 0d 23 09 | 74 6f 20 69 6e 69 74 69 | how .#.|to initi|
|000003e0| 61 6c 69 7a 65 20 74 68 | 65 20 63 6f 6d 6d 6f 6e |alize th|e common|
|000003f0| 6c 79 20 75 73 65 64 20 | 74 6f 6f 6c 62 6f 78 20 |ly used |toolbox |
|00000400| 6d 61 6e 61 67 65 72 73 | 2c 20 6f 70 65 72 61 74 |managers|, operat|
|00000410| 65 20 0d 23 09 73 75 63 | 63 65 73 73 66 75 6c 6c |e .#.suc|cessfull|
|00000420| 79 20 75 6e 64 65 72 20 | 4d 75 6c 74 69 46 69 6e |y under |MultiFin|
|00000430| 64 65 72 2c 20 68 61 6e | 64 6c 65 20 64 65 73 6b |der, han|dle desk|
|00000440| 20 61 63 63 65 73 73 6f | 72 69 65 73 20 61 6e 64 | accesso|ries and|
|00000450| 20 0d 23 09 63 72 65 61 | 74 65 2c 20 67 72 6f 77 | .#.crea|te, grow|
|00000460| 2c 20 61 6e 64 20 7a 6f | 6f 6d 20 77 69 6e 64 6f |, and zo|om windo|
|00000470| 77 73 2e 20 54 68 65 20 | 66 75 6e 64 61 6d 65 6e |ws. The |fundamen|
|00000480| 74 61 6c 20 54 65 78 74 | 45 64 69 74 20 0d 23 09 |tal Text|Edit .#.|
|00000490| 74 6f 6f 6c 62 6f 78 20 | 63 61 6c 6c 73 20 61 6e |toolbox |calls an|
|000004a0| 64 20 54 65 78 74 45 64 | 69 74 20 61 75 74 6f 73 |d TextEd|it autos|
|000004b0| 63 72 6f 6c 6c 20 61 72 | 65 20 64 65 6d 6f 6e 73 |croll ar|e demons|
|000004c0| 74 72 61 74 65 64 2e 20 | 49 74 20 0d 23 09 61 6c |trated. |It .#.al|
|000004d0| 73 6f 20 73 68 6f 77 73 | 20 68 6f 77 20 74 6f 20 |so shows| how to |
|000004e0| 63 72 65 61 74 65 20 61 | 6e 64 20 6d 61 69 6e 74 |create a|nd maint|
|000004f0| 61 69 6e 20 73 63 72 6f | 6c 6c 62 61 72 20 63 6f |ain scro|llbar co|
|00000500| 6e 74 72 6f 6c 73 2e 0d | 23 0d 23 09 49 74 20 64 |ntrols..|#.#.It d|
|00000510| 6f 65 73 20 6e 6f 74 20 | 62 79 20 61 6e 79 20 6d |oes not |by any m|
|00000520| 65 61 6e 73 20 64 65 6d | 6f 6e 73 74 72 61 74 65 |eans dem|onstrate|
|00000530| 20 61 6c 6c 20 74 68 65 | 20 74 65 63 68 6e 69 71 | all the| techniq|
|00000540| 75 65 73 20 79 6f 75 20 | 0d 23 09 6e 65 65 64 20 |ues you |.#.need |
|00000550| 66 6f 72 20 61 20 6c 61 | 72 67 65 20 61 70 70 6c |for a la|rge appl|
|00000560| 69 63 61 74 69 6f 6e 2e | 20 49 6e 20 70 61 72 74 |ication.| In part|
|00000570| 69 63 75 6c 61 72 2c 20 | 53 61 6d 70 6c 65 20 64 |icular, |Sample d|
|00000580| 6f 65 73 20 6e 6f 74 20 | 0d 23 09 63 6f 76 65 72 |oes not |.#.cover|
|00000590| 20 65 78 63 65 70 74 69 | 6f 6e 20 68 61 6e 64 6c | excepti|on handl|
|000005a0| 69 6e 67 2c 20 6d 75 6c | 74 69 70 6c 65 20 77 69 |ing, mul|tiple wi|
|000005b0| 6e 64 6f 77 73 2f 64 6f | 63 75 6d 65 6e 74 73 2c |ndows/do|cuments,|
|000005c0| 20 0d 23 09 73 6f 70 68 | 69 73 74 69 63 61 74 65 | .#.soph|isticate|
|000005d0| 64 20 6d 65 6d 6f 72 79 | 20 6d 61 6e 61 67 65 6d |d memory| managem|
|000005e0| 65 6e 74 2c 20 70 72 69 | 6e 74 69 6e 67 2c 20 6f |ent, pri|nting, o|
|000005f0| 72 20 75 6e 64 6f 2e 20 | 41 6c 6c 20 6f 66 20 0d |r undo. |All of .|
|00000600| 23 09 74 68 65 73 65 20 | 61 72 65 20 76 69 74 61 |#.these |are vita|
|00000610| 6c 20 70 61 72 74 73 20 | 6f 66 20 61 20 6e 6f 72 |l parts |of a nor|
|00000620| 6d 61 6c 20 66 75 6c 6c | 2d 73 69 7a 65 64 20 61 |mal full|-sized a|
|00000630| 70 70 6c 69 63 61 74 69 | 6f 6e 2e 0d 23 0d 23 09 |pplicati|on..#.#.|
|00000640| 54 68 69 73 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |This app|lication|
|00000650| 20 69 73 20 61 6e 20 65 | 78 61 6d 70 6c 65 20 6f | is an e|xample o|
|00000660| 66 20 74 68 65 20 66 6f | 72 6d 20 6f 66 20 61 20 |f the fo|rm of a |
|00000670| 4d 61 63 69 6e 74 6f 73 | 68 20 0d 23 09 61 70 70 |Macintos|h .#.app|
|00000680| 6c 69 63 61 74 69 6f 6e | 3b 20 69 74 20 69 73 20 |lication|; it is |
|00000690| 4e 4f 54 20 61 20 74 65 | 6d 70 6c 61 74 65 2e 20 |NOT a te|mplate. |
|000006a0| 49 74 20 69 73 20 4e 4f | 54 20 69 6e 74 65 6e 64 |It is NO|T intend|
|000006b0| 65 64 20 74 6f 20 62 65 | 20 0d 23 09 75 73 65 64 |ed to be| .#.used|
|000006c0| 20 61 73 20 61 20 66 6f | 75 6e 64 61 74 69 6f 6e | as a fo|undation|
|000006d0| 20 66 6f 72 20 74 68 65 | 20 6e 65 78 74 20 77 6f | for the| next wo|
|000006e0| 72 6c 64 2d 63 6c 61 73 | 73 2c 20 62 65 73 74 2d |rld-clas|s, best-|
|000006f0| 73 65 6c 6c 69 6e 67 2c | 20 0d 23 09 36 30 30 4b |selling,| .#.600K|
|00000700| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 2e 20 41 20 | applica|tion. A |
|00000710| 73 74 69 63 6b 20 66 69 | 67 75 72 65 20 64 72 61 |stick fi|gure dra|
|00000720| 77 69 6e 67 20 6f 66 20 | 74 68 65 20 68 75 6d 61 |wing of |the huma|
|00000730| 6e 20 62 6f 64 79 20 6d | 61 79 20 0d 23 09 62 65 |n body m|ay .#.be|
|00000740| 20 61 20 67 6f 6f 64 20 | 65 78 61 6d 70 6c 65 20 | a good |example |
|00000750| 6f 66 20 74 68 65 20 66 | 6f 72 6d 20 66 6f 72 20 |of the f|orm for |
|00000760| 61 20 70 61 69 6e 74 69 | 6e 67 2c 20 62 75 74 20 |a painti|ng, but |
|00000770| 74 68 61 74 20 64 6f 65 | 73 20 6e 6f 74 20 0d 23 |that doe|s not .#|
|00000780| 09 6d 65 61 6e 20 69 74 | 20 73 68 6f 75 6c 64 20 |.mean it| should |
|00000790| 62 65 20 75 73 65 64 20 | 61 73 20 74 68 65 20 62 |be used |as the b|
|000007a0| 61 73 69 73 20 66 6f 72 | 20 74 68 65 20 6e 65 78 |asis for| the nex|
|000007b0| 74 20 4d 6f 6e 61 20 4c | 69 73 61 2e 0d 23 0d 23 |t Mona L|isa..#.#|
|000007c0| 09 57 65 20 72 65 63 6f | 6d 6d 65 6e 64 20 74 68 |.We reco|mmend th|
|000007d0| 61 74 20 79 6f 75 20 72 | 65 76 69 65 77 20 74 68 |at you r|eview th|
|000007e0| 69 73 20 70 72 6f 67 72 | 61 6d 20 6f 72 20 53 61 |is progr|am or Sa|
|000007f0| 6d 70 6c 65 20 62 65 66 | 6f 72 65 20 0d 23 09 62 |mple bef|ore .#.b|
|00000800| 65 67 69 6e 6e 69 6e 67 | 20 61 20 6e 65 77 20 61 |eginning| a new a|
|00000810| 70 70 6c 69 63 61 74 69 | 6f 6e 2e 20 53 61 6d 70 |pplicati|on. Samp|
|00000820| 6c 65 20 69 73 20 61 20 | 73 69 6d 70 6c 65 20 61 |le is a |simple a|
|00000830| 70 70 2e 20 77 68 69 63 | 68 20 64 6f 65 73 6e d5 |pp. whic|h doesn.|
|00000840| 74 20 0d 23 09 75 73 65 | 20 54 65 78 74 45 64 69 |t .#.use| TextEdi|
|00000850| 74 20 6f 72 20 74 68 65 | 20 43 6f 6e 74 72 6f 6c |t or the| Control|
|00000860| 20 4d 61 6e 61 67 65 72 | 2e 0d 23 0d 2d 2d 2d 2d | Manager|..#.----|
|00000870| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000880| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000890| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000008a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000008b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 7d 0d 0d 0d 50 52 |--------|--}...PR|
|000008c0| 4f 47 52 41 4d 20 54 45 | 53 61 6d 70 6c 65 3b 0d |OGRAM TE|Sample;.|
|000008d0| 0d 0d 7b 53 65 67 6d 65 | 6e 74 61 74 69 6f 6e 20 |..{Segme|ntation |
|000008e0| 73 74 72 61 74 65 67 79 | 3a 0d 0d 20 54 68 69 73 |strategy|:.. This|
|000008f0| 20 70 72 6f 67 72 61 6d | 20 63 6f 6e 73 69 73 74 | program| consist|
|00000900| 73 20 6f 66 20 74 68 72 | 65 65 20 73 65 67 6d 65 |s of thr|ee segme|
|00000910| 6e 74 73 2e 20 4d 61 69 | 6e 20 63 6f 6e 74 61 69 |nts. Mai|n contai|
|00000920| 6e 73 20 6d 6f 73 74 20 | 6f 66 20 74 68 65 20 63 |ns most |of the c|
|00000930| 6f 64 65 2c 0d 20 69 6e | 63 6c 75 64 69 6e 67 20 |ode,. in|cluding |
|00000940| 74 68 65 20 4d 50 57 20 | 6c 69 62 72 61 72 69 65 |the MPW |librarie|
|00000950| 73 2c 20 61 6e 64 20 74 | 68 65 20 6d 61 69 6e 20 |s, and t|he main |
|00000960| 70 72 6f 67 72 61 6d 2e | 20 49 6e 69 74 69 61 6c |program.| Initial|
|00000970| 69 7a 65 20 63 6f 6e 74 | 61 69 6e 73 0d 20 63 6f |ize cont|ains. co|
|00000980| 64 65 20 74 68 61 74 20 | 69 73 20 6f 6e 6c 79 20 |de that |is only |
|00000990| 75 73 65 64 20 6f 6e 63 | 65 2c 20 64 75 72 69 6e |used onc|e, durin|
|000009a0| 67 20 73 74 61 72 74 75 | 70 2c 20 61 6e 64 20 63 |g startu|p, and c|
|000009b0| 61 6e 20 62 65 20 75 6e | 6c 6f 61 64 65 64 20 61 |an be un|loaded a|
|000009c0| 66 74 65 72 20 74 68 65 | 0d 20 70 72 6f 67 72 61 |fter the|. progra|
|000009d0| 6d 20 73 74 61 72 74 73 | 2e 20 25 41 35 49 6e 69 |m starts|. %A5Ini|
|000009e0| 74 20 69 73 20 61 75 74 | 6f 6d 61 74 69 63 61 6c |t is aut|omatical|
|000009f0| 6c 79 20 63 72 65 61 74 | 65 64 20 62 79 20 74 68 |ly creat|ed by th|
|00000a00| 65 20 4c 69 6e 6b 65 72 | 20 74 6f 20 69 6e 69 74 |e Linker| to init|
|00000a10| 69 61 6c 69 7a 65 0d 20 | 67 6c 6f 62 61 6c 73 20 |ialize. |globals |
|00000a20| 66 6f 72 20 74 68 65 20 | 4d 50 57 20 6c 69 62 72 |for the |MPW libr|
|00000a30| 61 72 69 65 73 20 61 6e | 64 20 69 73 20 75 6e 6c |aries an|d is unl|
|00000a40| 6f 61 64 65 64 20 72 69 | 67 68 74 20 61 77 61 79 |oaded ri|ght away|
|00000a50| 2e 7d 0d 0d 0d 7b 53 65 | 74 50 6f 72 74 20 73 74 |.}...{Se|tPort st|
|00000a60| 72 61 74 65 67 79 3a 0d | 0d 20 54 6f 6f 6c 62 6f |rategy:.|. Toolbo|
|00000a70| 78 20 72 6f 75 74 69 6e | 65 73 20 64 6f 20 6e 6f |x routin|es do no|
|00000a80| 74 20 63 68 61 6e 67 65 | 20 74 68 65 20 63 75 72 |t change| the cur|
|00000a90| 72 65 6e 74 20 70 6f 72 | 74 2e 20 49 6e 20 73 70 |rent por|t. In sp|
|00000aa0| 69 74 65 20 6f 66 20 74 | 68 69 73 2c 20 69 6e 20 |ite of t|his, in |
|00000ab0| 74 68 69 73 0d 20 70 72 | 6f 67 72 61 6d 20 77 65 |this. pr|ogram we|
|00000ac0| 20 75 73 65 20 61 20 73 | 74 72 61 74 65 67 79 20 | use a s|trategy |
|00000ad0| 6f 66 20 63 61 6c 6c 69 | 6e 67 20 53 65 74 50 6f |of calli|ng SetPo|
|00000ae0| 72 74 20 77 68 65 6e 65 | 76 65 72 20 77 65 20 77 |rt whene|ver we w|
|00000af0| 61 6e 74 20 74 6f 20 64 | 72 61 77 20 6f 72 0d 20 |ant to d|raw or. |
|00000b00| 6d 61 6b 65 20 63 61 6c | 6c 73 20 77 68 69 63 68 |make cal|ls which|
|00000b10| 20 64 65 70 65 6e 64 20 | 6f 6e 20 74 68 65 20 63 | depend |on the c|
|00000b20| 75 72 72 65 6e 74 20 70 | 6f 72 74 2e 20 54 68 69 |urrent p|ort. Thi|
|00000b30| 73 20 6d 61 6b 65 73 20 | 75 73 20 6c 65 73 73 20 |s makes |us less |
|00000b40| 76 75 6c 6e 65 72 61 62 | 6c 65 0d 20 74 6f 20 62 |vulnerab|le. to b|
|00000b50| 75 67 73 20 69 6e 20 6f | 74 68 65 72 20 73 6f 66 |ugs in o|ther sof|
|00000b60| 74 77 61 72 65 20 77 68 | 69 63 68 20 6d 69 67 68 |tware wh|ich migh|
|00000b70| 74 20 61 6c 74 65 72 20 | 74 68 65 20 63 75 72 72 |t alter |the curr|
|00000b80| 65 6e 74 20 70 6f 72 74 | 20 28 73 75 63 68 20 61 |ent port| (such a|
|00000b90| 73 20 74 68 65 0d 20 62 | 75 67 20 28 66 65 61 74 |s the. b|ug (feat|
|00000ba0| 75 72 65 3f 29 20 69 6e | 20 6d 61 6e 79 20 64 65 |ure?) in| many de|
|00000bb0| 73 6b 20 61 63 63 65 73 | 73 6f 72 69 65 73 20 77 |sk acces|sories w|
|00000bc0| 68 69 63 68 20 63 68 61 | 6e 67 65 20 74 68 65 20 |hich cha|nge the |
|00000bd0| 70 6f 72 74 20 6f 6e 20 | 4f 70 65 6e 44 65 73 6b |port on |OpenDesk|
|00000be0| 41 63 63 29 2e 0d 20 48 | 6f 70 65 66 75 6c 6c 79 |Acc).. H|opefully|
|00000bf0| 2c 20 74 68 69 73 20 61 | 6c 73 6f 20 6d 61 6b 65 |, this a|lso make|
|00000c00| 73 20 74 68 65 20 72 6f | 75 74 69 6e 65 73 20 66 |s the ro|utines f|
|00000c10| 72 6f 6d 20 74 68 69 73 | 20 70 72 6f 67 72 61 6d |rom this| program|
|00000c20| 20 6d 6f 72 65 20 73 65 | 6c 66 2d 63 6f 6e 74 61 | more se|lf-conta|
|00000c30| 69 6e 65 64 2c 0d 20 73 | 69 6e 63 65 20 74 68 65 |ined,. s|ince the|
|00000c40| 79 20 64 6f 6e 27 74 20 | 64 65 70 65 6e 64 20 6f |y don't |depend o|
|00000c50| 6e 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 70 6f |n the cu|rrent po|
|00000c60| 72 74 20 73 65 74 74 69 | 6e 67 2e 7d 0d 0d 0d 7b |rt setti|ng.}...{|
|00000c70| 43 6c 69 70 62 6f 61 72 | 64 20 73 74 72 61 74 65 |Clipboar|d strate|
|00000c80| 67 79 3a 0d 0d 20 54 68 | 69 73 20 70 72 6f 67 72 |gy:.. Th|is progr|
|00000c90| 61 6d 20 64 6f 65 73 20 | 6e 6f 74 20 6d 61 69 6e |am does |not main|
|00000ca0| 74 61 69 6e 20 61 20 70 | 72 69 76 61 74 65 20 73 |tain a p|rivate s|
|00000cb0| 63 72 61 70 2e 20 57 68 | 65 6e 65 76 65 72 20 61 |crap. Wh|enever a|
|00000cc0| 20 63 75 74 2c 20 63 6f | 70 79 2c 20 6f 72 20 70 | cut, co|py, or p|
|00000cd0| 61 73 74 65 0d 20 6f 63 | 63 75 72 73 2c 20 77 65 |aste. oc|curs, we|
|00000ce0| 20 69 6d 70 6f 72 74 2f | 65 78 70 6f 72 74 20 66 | import/|export f|
|00000cf0| 72 6f 6d 20 74 68 65 20 | 70 75 62 6c 69 63 20 73 |rom the |public s|
|00000d00| 63 72 61 70 20 74 6f 20 | 54 65 78 74 45 64 69 74 |crap to |TextEdit|
|00000d10| 27 73 20 73 63 72 61 70 | 20 72 69 67 68 74 20 61 |'s scrap| right a|
|00000d20| 77 61 79 2c 0d 20 75 73 | 69 6e 67 20 74 68 65 20 |way,. us|ing the |
|00000d30| 54 45 54 6f 53 63 72 61 | 70 20 61 6e 64 20 54 45 |TEToScra|p and TE|
|00000d40| 46 72 6f 6d 53 63 72 61 | 70 20 72 6f 75 74 69 6e |FromScra|p routin|
|00000d50| 65 73 2e 20 49 66 20 77 | 65 20 64 69 64 20 75 73 |es. If w|e did us|
|00000d60| 65 20 61 20 70 72 69 76 | 61 74 65 20 73 63 72 61 |e a priv|ate scra|
|00000d70| 70 2c 0d 20 74 68 65 20 | 69 6d 70 6f 72 74 2f 65 |p,. the |import/e|
|00000d80| 78 70 6f 72 74 20 77 6f | 75 6c 64 20 62 65 20 69 |xport wo|uld be i|
|00000d90| 6e 20 74 68 65 20 61 63 | 74 69 76 61 74 65 2f 64 |n the ac|tivate/d|
|00000da0| 65 61 63 74 69 76 61 74 | 65 20 65 76 65 6e 74 20 |eactivat|e event |
|00000db0| 61 6e 64 20 73 75 73 70 | 65 6e 64 2f 72 65 73 75 |and susp|end/resu|
|00000dc0| 6d 65 0d 20 65 76 65 6e | 74 20 72 6f 75 74 69 6e |me. even|t routin|
|00000dd0| 65 73 2e 7d 0d 0d 7b 24 | 44 2b 7d 0d 0d 55 53 45 |es.}..{$|D+}..USE|
|00000de0| 53 0d 09 4d 65 6d 54 79 | 70 65 73 2c 20 51 75 69 |S..MemTy|pes, Qui|
|00000df0| 63 6b 44 72 61 77 2c 20 | 4f 53 49 6e 74 66 2c 20 |ckDraw, |OSIntf, |
|00000e00| 54 6f 6f 6c 49 6e 74 66 | 2c 20 50 61 63 6b 49 6e |ToolIntf|, PackIn|
|00000e10| 74 66 2c 20 54 72 61 70 | 73 3b 0d 0d 0d 43 4f 4e |tf, Trap|s;...CON|
|00000e20| 53 54 0d 09 7b 4d 50 57 | 20 33 2e 30 20 77 69 6c |ST..{MPW| 3.0 wil|
|00000e30| 6c 20 69 6e 63 6c 75 64 | 65 20 61 20 54 72 61 70 |l includ|e a Trap|
|00000e40| 73 2e 70 20 69 6e 74 65 | 72 66 61 63 65 20 66 69 |s.p inte|rface fi|
|00000e50| 6c 65 20 74 68 61 74 20 | 69 6e 63 6c 75 64 65 73 |le that |includes|
|00000e60| 20 63 6f 6e 73 74 61 6e | 74 73 20 66 6f 72 20 74 | constan|ts for t|
|00000e70| 72 61 70 20 6e 75 6d 62 | 65 72 73 2e 0d 09 20 54 |rap numb|ers... T|
|00000e80| 68 65 73 65 20 63 6f 6e | 73 74 61 6e 74 73 20 61 |hese con|stants a|
|00000e90| 72 65 20 66 72 6f 6d 20 | 74 68 61 74 20 66 69 6c |re from |that fil|
|00000ea0| 65 2e 7d 0d 09 7b 31 2e | 30 32 20 2d 20 55 73 65 |e.}..{1.|02 - Use|
|00000eb0| 73 20 54 72 61 70 73 2e | 70 20 74 6f 20 6f 62 74 |s Traps.|p to obt|
|00000ec0| 61 69 6e 20 74 72 61 70 | 20 6e 75 6d 62 65 72 73 |ain trap| numbers|
|00000ed0| 2e 7d 0d 0d 09 7b 31 2e | 30 31 20 2d 20 63 68 61 |.}...{1.|01 - cha|
|00000ee0| 6e 67 65 64 20 63 6f 6e | 73 74 61 6e 74 73 20 74 |nged con|stants t|
|00000ef0| 6f 20 62 65 67 69 6e 20 | 77 69 74 68 20 27 6b 27 |o begin |with 'k'|
|00000f00| 20 66 6f 72 20 63 6f 6e | 73 69 73 74 65 6e 63 79 | for con|sistency|
|00000f10| 2c 20 65 78 63 65 70 74 | 20 66 6f 72 20 72 65 73 |, except| for res|
|00000f20| 6f 75 72 63 65 20 49 44 | 73 7d 0d 09 7b 6b 54 65 |ource ID|s}..{kTe|
|00000f30| 78 74 4d 61 72 67 69 6e | 20 69 73 20 74 68 65 20 |xtMargin| is the |
|00000f40| 6e 75 6d 62 65 72 20 6f | 66 20 70 69 78 65 6c 73 |number o|f pixels|
|00000f50| 20 77 65 20 6c 65 61 76 | 65 20 62 6c 61 6e 6b 20 | we leav|e blank |
|00000f60| 61 74 20 74 68 65 20 65 | 64 67 65 20 6f 66 20 74 |at the e|dge of t|
|00000f70| 68 65 20 77 69 6e 64 6f | 77 2e 7d 0d 09 6b 54 65 |he windo|w.}..kTe|
|00000f80| 78 74 4d 61 72 67 69 6e | 09 09 09 09 3d 20 32 3b |xtMargin|....= 2;|
|00000f90| 0d 0d 09 7b 6b 4d 61 78 | 4f 70 65 6e 44 6f 63 75 |...{kMax|OpenDocu|
|00000fa0| 6d 65 6e 74 73 20 69 73 | 20 75 73 65 64 20 74 6f |ments is| used to|
|00000fb0| 20 64 65 74 65 72 6d 69 | 6e 65 20 77 68 65 74 68 | determi|ne wheth|
|00000fc0| 65 72 20 61 20 6e 65 77 | 20 64 6f 63 75 6d 65 6e |er a new| documen|
|00000fd0| 74 20 63 61 6e 20 62 65 | 20 6f 70 65 6e 65 64 0d |t can be| opened.|
|00000fe0| 09 20 6f 72 20 63 72 65 | 61 74 65 64 2e 20 57 65 |. or cre|ated. We|
|00000ff0| 20 6b 65 65 70 20 74 72 | 61 63 6b 20 6f 66 20 74 | keep tr|ack of t|
|00001000| 68 65 20 6e 75 6d 62 65 | 72 20 6f 66 20 6f 70 65 |he numbe|r of ope|
|00001010| 6e 20 64 6f 63 75 6d 65 | 6e 74 73 2c 20 61 6e 64 |n docume|nts, and|
|00001020| 20 64 69 73 61 62 6c 65 | 20 74 68 65 0d 09 20 6d | disable| the.. m|
|00001030| 65 6e 75 20 69 74 65 6d | 73 20 74 68 61 74 20 63 |enu item|s that c|
|00001040| 72 65 61 74 65 20 61 20 | 6e 65 77 20 64 6f 63 75 |reate a |new docu|
|00001050| 6d 65 6e 74 20 77 68 65 | 6e 20 74 68 65 20 6d 61 |ment whe|n the ma|
|00001060| 78 69 6d 75 6d 20 69 73 | 20 72 65 61 63 68 65 64 |ximum is| reached|
|00001070| 2e 20 49 66 20 74 68 65 | 0d 09 20 6e 75 6d 62 65 |. If the|.. numbe|
|00001080| 72 20 6f 66 20 64 6f 63 | 75 6d 65 6e 74 73 20 66 |r of doc|uments f|
|00001090| 61 6c 6c 73 20 62 65 6c | 6f 77 20 74 68 65 20 6d |alls bel|ow the m|
|000010a0| 61 78 69 6d 75 6d 2c 20 | 74 68 65 20 69 74 65 6d |aximum, |the item|
|000010b0| 73 20 61 72 65 20 65 6e | 61 62 6c 65 64 20 61 67 |s are en|abled ag|
|000010c0| 61 69 6e 2e 7d 0d 09 6b | 4d 61 78 4f 70 65 6e 44 |ain.}..k|MaxOpenD|
|000010d0| 6f 63 75 6d 65 6e 74 73 | 09 09 3d 20 31 3b 0d 09 |ocuments|..= 1;..|
|000010e0| 0d 09 7b 6b 4d 61 78 44 | 6f 63 57 69 64 74 68 20 |..{kMaxD|ocWidth |
|000010f0| 69 73 20 61 6e 20 61 72 | 62 69 74 72 61 72 79 20 |is an ar|bitrary |
|00001100| 6e 75 6d 62 65 72 20 75 | 73 65 64 20 74 6f 20 73 |number u|sed to s|
|00001110| 70 65 63 69 66 79 20 74 | 68 65 20 77 69 64 74 68 |pecify t|he width|
|00001120| 20 6f 66 20 74 68 65 20 | 54 45 52 65 63 27 73 0d | of the |TERec's.|
|00001130| 09 64 65 73 74 69 6e 61 | 74 69 6f 6e 20 72 65 63 |.destina|tion rec|
|00001140| 74 61 6e 67 6c 65 20 73 | 6f 20 74 68 61 74 20 77 |tangle s|o that w|
|00001150| 6f 72 64 20 77 72 61 70 | 20 61 6e 64 20 68 6f 72 |ord wrap| and hor|
|00001160| 69 7a 6f 6e 74 61 6c 20 | 73 63 72 6f 6c 6c 69 6e |izontal |scrollin|
|00001170| 67 20 63 61 6e 20 62 65 | 0d 09 64 65 6d 6f 6e 73 |g can be|..demons|
|00001180| 74 72 61 74 65 64 2e 7d | 0d 09 6b 4d 61 78 44 6f |trated.}|..kMaxDo|
|00001190| 63 57 69 64 74 68 09 09 | 09 3d 20 35 37 36 3b 0d |cWidth..|.= 576;.|
|000011a0| 09 0d 09 7b 6b 4d 69 6e | 44 6f 63 44 69 6d 20 69 |...{kMin|DocDim i|
|000011b0| 73 20 75 73 65 64 20 74 | 6f 20 6c 69 6d 69 74 20 |s used t|o limit |
|000011c0| 74 68 65 20 6d 69 6e 69 | 6d 75 6d 20 64 69 6d 65 |the mini|mum dime|
|000011d0| 6e 73 69 6f 6e 20 6f 66 | 20 61 20 77 69 6e 64 6f |nsion of| a windo|
|000011e0| 77 20 77 68 65 6e 20 47 | 72 6f 77 57 69 6e 64 6f |w when G|rowWindo|
|000011f0| 77 0d 09 69 73 20 63 61 | 6c 6c 65 64 2e 7d 0d 09 |w..is ca|lled.}..|
|00001200| 6b 4d 69 6e 44 6f 63 44 | 69 6d 09 09 09 09 3d 20 |kMinDocD|im....= |
|00001210| 36 34 3b 0d 09 0d 09 7b | 6b 43 6f 6e 74 72 6f 6c |64;....{|kControl|
|00001220| 49 6e 76 69 73 69 62 6c | 65 20 69 73 20 75 73 65 |Invisibl|e is use|
|00001230| 64 20 74 6f 20 27 74 75 | 72 6e 20 6f 66 66 27 20 |d to 'tu|rn off' |
|00001240| 63 6f 6e 74 72 6f 6c 73 | 20 28 69 2e 65 2e 2c 20 |controls| (i.e., |
|00001250| 63 61 75 73 65 20 74 68 | 65 20 63 6f 6e 74 72 6f |cause th|e contro|
|00001260| 6c 20 6e 6f 74 0d 09 74 | 6f 20 62 65 20 72 65 64 |l not..t|o be red|
|00001270| 72 61 77 6e 20 61 73 20 | 61 20 72 65 73 75 6c 74 |rawn as |a result|
|00001280| 20 6f 66 20 73 6f 6d 65 | 20 43 6f 6e 74 72 6f 6c | of some| Control|
|00001290| 20 4d 61 6e 61 67 65 72 | 20 63 61 6c 6c 20 73 75 | Manager| call su|
|000012a0| 63 68 20 61 73 20 53 65 | 74 43 74 6c 56 61 6c 75 |ch as Se|tCtlValu|
|000012b0| 65 29 0d 09 62 79 20 62 | 65 69 6e 67 20 70 75 74 |e)..by b|eing put|
|000012c0| 20 69 6e 74 6f 20 74 68 | 65 20 63 6f 6e 74 72 6c | into th|e contrl|
|000012d0| 56 69 73 20 66 69 65 6c | 64 20 6f 66 20 74 68 65 |Vis fiel|d of the|
|000012e0| 20 72 65 63 6f 72 64 2e | 20 6b 43 6f 6e 74 72 6f | record.| kContro|
|000012f0| 6c 56 69 73 69 62 6c 65 | 20 69 73 20 75 73 65 64 |lVisible| is used|
|00001300| 0d 09 74 68 65 20 73 61 | 6d 65 20 77 61 79 20 74 |..the sa|me way t|
|00001310| 6f 20 27 74 75 72 6e 20 | 6f 6e 27 20 74 68 65 20 |o 'turn |on' the |
|00001320| 63 6f 6e 74 72 6f 6c 2e | 7d 0d 09 6b 43 6f 6e 74 |control.|}..kCont|
|00001330| 72 6f 6c 49 6e 76 69 73 | 69 62 6c 65 09 09 3d 20 |rolInvis|ible..= |
|00001340| 30 3b 0d 09 6b 43 6f 6e | 74 72 6f 6c 56 69 73 69 |0;..kCon|trolVisi|
|00001350| 62 6c 65 09 09 09 3d 20 | 24 46 46 3b 0d 09 0d 09 |ble...= |$FF;....|
|00001360| 7b 6b 53 63 72 6f 6c 6c | 42 61 72 41 64 6a 75 73 |{kScroll|BarAdjus|
|00001370| 74 20 61 6e 64 20 6b 53 | 63 72 6f 6c 6c 42 61 72 |t and kS|crollBar|
|00001380| 57 69 64 74 68 20 61 72 | 65 20 75 73 65 64 20 69 |Width ar|e used i|
|00001390| 6e 20 63 61 6c 63 75 6c | 61 74 69 6e 67 0d 09 76 |n calcul|ating..v|
|000013a0| 61 6c 75 65 73 20 66 6f | 72 20 63 6f 6e 74 72 6f |alues fo|r contro|
|000013b0| 6c 20 70 6f 73 69 74 69 | 6f 6e 69 6e 67 20 61 6e |l positi|oning an|
|000013c0| 64 20 73 69 7a 69 6e 67 | 2e 7d 0d 09 6b 53 63 72 |d sizing|.}..kScr|
|000013d0| 6f 6c 6c 62 61 72 57 69 | 64 74 68 09 09 09 3d 20 |ollbarWi|dth...= |
|000013e0| 31 36 3b 0d 09 6b 53 63 | 72 6f 6c 6c 62 61 72 41 |16;..kSc|rollbarA|
|000013f0| 64 6a 75 73 74 09 09 3d | 20 6b 53 63 72 6f 6c 6c |djust..=| kScroll|
|00001400| 62 61 72 57 69 64 74 68 | 20 2d 20 31 3b 0d 09 0d |barWidth| - 1;...|
|00001410| 09 7b 6b 53 63 72 6f 6c | 6c 54 77 65 65 6b 20 63 |.{kScrol|lTweek c|
|00001420| 6f 6d 70 65 6e 73 61 74 | 65 73 20 66 6f 72 20 6f |ompensat|es for o|
|00001430| 66 66 2d 62 79 2d 6f 6e | 65 20 72 65 71 75 69 72 |ff-by-on|e requir|
|00001440| 65 6d 65 6e 74 73 20 6f | 66 20 74 68 65 20 73 63 |ements o|f the sc|
|00001450| 72 6f 6c 6c 62 61 72 73 | 0d 20 09 74 6f 20 68 61 |rollbars|. .to ha|
|00001460| 76 65 20 62 6f 72 64 65 | 72 73 20 63 6f 69 6e 63 |ve borde|rs coinc|
|00001470| 69 64 65 20 77 69 74 68 | 20 74 68 65 20 67 72 6f |ide with| the gro|
|00001480| 77 62 6f 78 2e 7d 0d 09 | 6b 53 63 72 6f 6c 6c 54 |wbox.}..|kScrollT|
|00001490| 77 65 65 6b 09 09 09 3d | 20 32 3b 0d 09 0d 09 7b |week...=| 2;....{|
|000014a0| 6b 43 72 43 68 61 72 20 | 69 73 20 75 73 65 64 20 |kCrChar |is used |
|000014b0| 74 6f 20 6d 61 74 63 68 | 20 77 69 74 68 20 61 20 |to match| with a |
|000014c0| 63 61 72 72 69 61 67 65 | 20 72 65 74 75 72 6e 20 |carriage| return |
|000014d0| 77 68 65 6e 20 63 61 6c | 63 75 6c 61 74 69 6e 67 |when cal|culating|
|000014e0| 20 74 68 65 0d 09 6e 75 | 6d 62 65 72 20 6f 66 20 | the..nu|mber of |
|000014f0| 6c 69 6e 65 73 20 69 6e | 20 74 68 65 20 54 65 78 |lines in| the Tex|
|00001500| 74 45 64 69 74 20 72 65 | 63 6f 72 64 2e 20 6b 44 |tEdit re|cord. kD|
|00001510| 65 6c 43 68 61 72 20 69 | 73 20 75 73 65 64 20 74 |elChar i|s used t|
|00001520| 6f 20 63 68 65 63 6b 20 | 66 6f 72 0d 09 64 65 6c |o check |for..del|
|00001530| 65 74 65 20 69 6e 20 6b | 65 79 44 6f 77 6e 73 2e |ete in k|eyDowns.|
|00001540| 7d 0d 09 6b 43 52 43 68 | 61 72 09 09 09 09 09 3d |}..kCRCh|ar.....=|
|00001550| 20 31 33 3b 0d 09 6b 44 | 65 6c 43 68 61 72 09 09 | 13;..kD|elChar..|
|00001560| 09 09 3d 20 38 3b 0d 09 | 0d 09 7b 6b 42 75 74 74 |..= 8;..|..{kButt|
|00001570| 6f 6e 53 63 72 6f 6c 6c | 20 69 73 20 68 6f 77 20 |onScroll| is how |
|00001580| 6d 61 6e 79 20 70 69 78 | 65 6c 73 20 74 6f 20 73 |many pix|els to s|
|00001590| 63 72 6f 6c 6c 20 68 6f | 72 69 7a 6f 6e 74 61 6c |croll ho|rizontal|
|000015a0| 6c 79 20 77 68 65 6e 20 | 74 68 65 20 62 75 74 74 |ly when |the butt|
|000015b0| 6f 6e 20 70 61 72 74 0d | 09 6f 66 20 74 68 65 20 |on part.|.of the |
|000015c0| 68 6f 72 69 7a 6f 6e 74 | 61 6c 20 73 63 72 6f 6c |horizont|al scrol|
|000015d0| 6c 62 61 72 20 69 73 20 | 70 72 65 73 73 65 64 2e |lbar is |pressed.|
|000015e0| 7d 0d 09 6b 42 75 74 74 | 6f 6e 53 63 72 6f 6c 6c |}..kButt|onScroll|
|000015f0| 09 09 09 3d 20 34 3b 0d | 09 0d 09 7b 6b 4d 61 78 |...= 4;.|...{kMax|
|00001600| 54 45 4c 65 6e 67 74 68 | 20 69 73 20 61 6e 20 61 |TELength| is an a|
|00001610| 72 62 69 74 72 61 72 79 | 20 6e 75 6d 62 65 72 20 |rbitrary| number |
|00001620| 75 73 65 64 20 74 6f 20 | 6c 69 6d 69 74 20 74 68 |used to |limit th|
|00001630| 65 20 6c 65 6e 67 74 68 | 20 6f 66 20 74 65 78 74 |e length| of text|
|00001640| 20 69 6e 20 74 68 65 20 | 54 45 52 65 63 0d 09 73 | in the |TERec..s|
|00001650| 6f 20 74 68 61 74 20 76 | 61 72 69 6f 75 73 20 65 |o that v|arious e|
|00001660| 72 72 6f 72 73 20 77 6f | 6e 27 74 20 6f 63 63 75 |rrors wo|n't occu|
|00001670| 72 20 66 72 6f 6d 20 74 | 6f 6f 20 6d 61 6e 79 20 |r from t|oo many |
|00001680| 63 68 61 72 61 63 74 65 | 72 73 20 69 6e 20 74 68 |characte|rs in th|
|00001690| 65 20 74 65 78 74 2e 7d | 0d 09 6b 4d 61 78 54 45 |e text.}|..kMaxTE|
|000016a0| 4c 65 6e 67 74 68 09 09 | 09 3d 20 33 32 30 30 30 |Length..|.= 32000|
|000016b0| 3b 0d 0d 09 7b 6b 53 79 | 73 45 6e 76 69 72 6f 6e |;...{kSy|sEnviron|
|000016c0| 73 56 65 72 73 69 6f 6e | 20 69 73 20 70 61 73 73 |sVersion| is pass|
|000016d0| 65 64 20 74 6f 20 53 79 | 73 45 6e 76 69 72 6f 6e |ed to Sy|sEnviron|
|000016e0| 73 20 74 6f 20 74 65 6c | 6c 20 69 74 20 77 68 69 |s to tel|l it whi|
|000016f0| 63 68 20 76 65 72 73 69 | 6f 6e 20 6f 66 20 74 68 |ch versi|on of th|
|00001700| 65 0d 09 20 53 79 73 45 | 6e 76 52 65 63 20 77 65 |e.. SysE|nvRec we|
|00001710| 20 75 6e 64 65 72 73 74 | 61 6e 64 2e 7d 0d 09 6b | underst|and.}..k|
|00001720| 53 79 73 45 6e 76 69 72 | 6f 6e 73 56 65 72 73 69 |SysEnvir|onsVersi|
|00001730| 6f 6e 09 09 3d 20 31 3b | 0d 0d 09 7b 6b 4f 53 45 |on..= 1;|...{kOSE|
|00001740| 76 65 6e 74 20 69 73 20 | 74 68 65 20 65 76 65 6e |vent is |the even|
|00001750| 74 20 6e 75 6d 62 65 72 | 20 6f 66 20 74 68 65 20 |t number| of the |
|00001760| 73 75 73 70 65 6e 64 2f | 72 65 73 75 6d 65 20 61 |suspend/|resume a|
|00001770| 6e 64 20 6d 6f 75 73 65 | 2d 6d 6f 76 65 64 20 65 |nd mouse|-moved e|
|00001780| 76 65 6e 74 73 20 73 65 | 6e 74 0d 09 20 62 79 20 |vents se|nt.. by |
|00001790| 4d 75 6c 74 69 46 69 6e | 64 65 72 2e 20 4f 6e 63 |MultiFin|der. Onc|
|000017a0| 65 20 77 65 20 64 65 74 | 65 72 6d 69 6e 65 20 74 |e we det|ermine t|
|000017b0| 68 61 74 20 61 6e 20 65 | 76 65 6e 74 20 69 73 20 |hat an e|vent is |
|000017c0| 61 6e 20 6f 73 45 76 65 | 6e 74 2c 20 77 65 20 6c |an osEve|nt, we l|
|000017d0| 6f 6f 6b 20 61 74 20 74 | 68 65 0d 09 20 68 69 67 |ook at t|he.. hig|
|000017e0| 68 20 62 79 74 65 20 6f | 66 20 74 68 65 20 6d 65 |h byte o|f the me|
|000017f0| 73 73 61 67 65 20 73 65 | 6e 74 20 74 6f 20 64 65 |ssage se|nt to de|
|00001800| 74 65 72 6d 69 6e 65 20 | 77 68 69 63 68 20 6b 69 |termine |which ki|
|00001810| 6e 64 20 69 74 20 69 73 | 2e 20 54 6f 20 64 69 66 |nd it is|. To dif|
|00001820| 66 65 72 65 6e 74 69 61 | 74 65 0d 09 20 73 75 73 |ferentia|te.. sus|
|00001830| 70 65 6e 64 20 61 6e 64 | 20 72 65 73 75 6d 65 20 |pend and| resume |
|00001840| 65 76 65 6e 74 73 20 77 | 65 20 63 68 65 63 6b 20 |events w|e check |
|00001850| 74 68 65 20 72 65 73 75 | 6d 65 4d 61 73 6b 20 62 |the resu|meMask b|
|00001860| 69 74 2e 7d 0d 09 6b 4f | 53 45 76 65 6e 74 09 09 |it.}..kO|SEvent..|
|00001870| 09 09 3d 20 61 70 70 34 | 45 76 74 3b 09 7b 65 76 |..= app4|Evt;.{ev|
|00001880| 65 6e 74 20 75 73 65 64 | 20 62 79 20 4d 75 6c 74 |ent used| by Mult|
|00001890| 69 46 69 6e 64 65 72 7d | 0d 09 6b 53 75 73 70 65 |iFinder}|..kSuspe|
|000018a0| 6e 64 52 65 73 75 6d 65 | 4d 65 73 73 61 67 65 09 |ndResume|Message.|
|000018b0| 3d 20 31 3b 09 09 7b 68 | 69 67 68 20 62 79 74 65 |= 1;..{h|igh byte|
|000018c0| 20 6f 66 20 73 75 73 70 | 65 6e 64 2f 72 65 73 75 | of susp|end/resu|
|000018d0| 6d 65 20 65 76 65 6e 74 | 20 6d 65 73 73 61 67 65 |me event| message|
|000018e0| 7d 0d 09 6b 52 65 73 75 | 6d 65 4d 61 73 6b 09 09 |}..kResu|meMask..|
|000018f0| 09 09 3d 20 31 3b 09 09 | 7b 62 69 74 20 6f 66 20 |..= 1;..|{bit of |
|00001900| 6d 65 73 73 61 67 65 20 | 66 69 65 6c 64 20 66 6f |message |field fo|
|00001910| 72 20 72 65 73 75 6d 65 | 20 76 73 2e 20 73 75 73 |r resume| vs. sus|
|00001920| 70 65 6e 64 7d 0d 09 6b | 4d 6f 75 73 65 4d 6f 76 |pend}..k|MouseMov|
|00001930| 65 64 4d 65 73 73 61 67 | 65 09 09 3d 20 24 46 41 |edMessag|e..= $FA|
|00001940| 3b 09 09 7b 68 69 67 68 | 20 62 79 74 65 20 6f 66 |;..{high| byte of|
|00001950| 20 6d 6f 75 73 65 2d 6d | 6f 76 65 64 20 65 76 65 | mouse-m|oved eve|
|00001960| 6e 74 20 6d 65 73 73 61 | 67 65 7d 0d 09 6b 4e 6f |nt messa|ge}..kNo|
|00001970| 45 76 65 6e 74 73 09 09 | 09 09 3d 20 30 3b 09 09 |Events..|..= 0;..|
|00001980| 7b 6e 6f 20 65 76 65 6e | 74 73 20 6d 61 73 6b 7d |{no even|ts mask}|
|00001990| 0d 0d 09 7b 31 2e 30 31 | 20 2d 20 6b 4d 69 6e 48 |...{1.01| - kMinH|
|000019a0| 65 61 70 20 2d 20 54 68 | 69 73 20 69 73 20 74 68 |eap - Th|is is th|
|000019b0| 65 20 6d 69 6e 69 6d 75 | 6d 20 72 65 73 75 6c 74 |e minimu|m result|
|000019c0| 20 66 72 6f 6d 20 74 68 | 65 20 66 6f 6c 6c 6f 77 | from th|e follow|
|000019d0| 69 6e 67 0d 09 20 65 71 | 75 61 74 69 6f 6e 3a 0d |ing.. eq|uation:.|
|000019e0| 09 09 09 0d 09 09 09 4f | 52 44 28 47 65 74 41 70 |.......O|RD(GetAp|
|000019f0| 70 6c 4c 69 6d 69 74 29 | 20 2d 20 4f 52 44 28 41 |plLimit)| - ORD(A|
|00001a00| 70 70 6c 69 63 5a 6f 6e | 65 29 0d 09 09 09 0d 09 |pplicZon|e)......|
|00001a10| 20 66 6f 72 20 74 68 65 | 20 61 70 70 6c 69 63 61 | for the| applica|
|00001a20| 74 69 6f 6e 20 74 6f 20 | 72 75 6e 2e 20 49 74 20 |tion to |run. It |
|00001a30| 77 69 6c 6c 20 69 6e 73 | 75 72 65 20 74 68 61 74 |will ins|ure that|
|00001a40| 20 65 6e 6f 75 67 68 20 | 6d 65 6d 6f 72 79 20 77 | enough |memory w|
|00001a50| 69 6c 6c 0d 09 20 62 65 | 20 61 72 6f 75 6e 64 20 |ill.. be| around |
|00001a60| 66 6f 72 20 72 65 61 73 | 6f 6e 61 62 6c 65 2d 73 |for reas|onable-s|
|00001a70| 69 7a 65 64 20 73 63 72 | 61 70 73 2c 20 46 4b 45 |ized scr|aps, FKE|
|00001a80| 59 73 2c 20 65 74 63 2e | 20 74 6f 20 65 78 69 73 |Ys, etc.| to exis|
|00001a90| 74 20 77 69 74 68 20 74 | 68 65 0d 09 20 61 70 70 |t with t|he.. app|
|00001aa0| 6c 69 63 61 74 69 6f 6e | 2c 20 61 6e 64 20 73 74 |lication|, and st|
|00001ab0| 69 6c 6c 20 67 69 76 65 | 20 74 68 65 20 61 70 70 |ill give| the app|
|00001ac0| 6c 69 63 61 74 69 6f 6e | 20 73 6f 6d 65 20 27 62 |lication| some 'b|
|00001ad0| 72 65 61 74 68 69 6e 67 | 20 72 6f 6f 6d 27 2e 0d |reathing| room'..|
|00001ae0| 09 20 54 6f 20 64 65 72 | 69 76 65 20 74 68 69 73 |. To der|ive this|
|00001af0| 20 6e 75 6d 62 65 72 2c | 20 77 65 20 72 61 6e 20 | number,| we ran |
|00001b00| 75 6e 64 65 72 20 61 20 | 4d 75 6c 74 69 46 69 6e |under a |MultiFin|
|00001b10| 64 65 72 20 70 61 72 74 | 69 74 69 6f 6e 20 74 68 |der part|ition th|
|00001b20| 61 74 20 77 61 73 0d 09 | 20 6f 75 72 20 72 65 71 |at was..| our req|
|00001b30| 75 65 73 74 65 64 20 6d | 69 6e 69 6d 75 6d 20 73 |uested m|inimum s|
|00001b40| 69 7a 65 2c 20 61 73 20 | 67 69 76 65 6e 20 69 6e |ize, as |given in|
|00001b50| 20 74 68 65 20 27 53 49 | 5a 45 27 20 72 65 73 6f | the 'SI|ZE' reso|
|00001b60| 75 72 63 65 2e 7d 0d 09 | 20 0d 09 6b 4d 69 6e 48 |urce.}..| ..kMinH|
|00001b70| 65 61 70 09 3d 20 32 39 | 20 2a 20 31 30 32 34 3b |eap.= 29| * 1024;|
|00001b80| 0d 09 0d 09 7b 31 2e 30 | 31 20 2d 20 6b 4d 69 6e |....{1.0|1 - kMin|
|00001b90| 53 70 61 63 65 20 2d 20 | 54 68 69 73 20 69 73 20 |Space - |This is |
|00001ba0| 74 68 65 20 6d 69 6e 69 | 6d 75 6d 20 72 65 73 75 |the mini|mum resu|
|00001bb0| 6c 74 20 66 72 6f 6d 20 | 50 75 72 67 65 53 70 61 |lt from |PurgeSpa|
|00001bc0| 63 65 2c 20 77 68 65 6e | 20 63 61 6c 6c 65 64 0d |ce, when| called.|
|00001bd0| 09 20 61 74 20 69 6e 69 | 74 69 61 6c 69 7a 61 74 |. at ini|tializat|
|00001be0| 69 6f 6e 20 74 69 6d 65 | 2c 20 66 6f 72 20 74 68 |ion time|, for th|
|00001bf0| 65 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 20 74 6f |e applic|ation to|
|00001c00| 20 72 75 6e 2e 20 54 68 | 69 73 20 6e 75 6d 62 65 | run. Th|is numbe|
|00001c10| 72 20 61 63 74 73 0d 09 | 20 61 73 20 61 20 64 6f |r acts..| as a do|
|00001c20| 75 62 6c 65 2d 63 68 65 | 63 6b 20 74 6f 20 69 6e |uble-che|ck to in|
|00001c30| 73 75 72 65 20 74 68 61 | 74 20 74 68 65 72 65 20 |sure tha|t there |
|00001c40| 72 65 61 6c 6c 79 20 69 | 73 20 65 6e 6f 75 67 68 |really i|s enough|
|00001c50| 20 6d 65 6d 6f 72 79 20 | 66 6f 72 20 74 68 65 0d | memory |for the.|
|00001c60| 09 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 20 74 6f |. applic|ation to|
|00001c70| 20 72 75 6e 2c 20 69 6e | 63 6c 75 64 69 6e 67 20 | run, in|cluding |
|00001c80| 77 68 61 74 20 68 61 73 | 20 62 65 65 6e 20 74 61 |what has| been ta|
|00001c90| 6b 65 6e 20 75 70 20 61 | 6c 72 65 61 64 79 20 62 |ken up a|lready b|
|00001ca0| 79 0d 09 20 70 72 65 2d | 6c 6f 61 64 65 64 20 72 |y.. pre-|loaded r|
|00001cb0| 65 73 6f 75 72 63 65 73 | 2c 20 74 68 65 20 73 63 |esources|, the sc|
|00001cc0| 72 61 70 2c 20 63 6f 64 | 65 2c 20 61 6e 64 20 6f |rap, cod|e, and o|
|00001cd0| 74 68 65 72 20 73 75 6e | 64 72 79 20 6d 65 6d 6f |ther sun|dry memo|
|00001ce0| 72 79 20 62 6c 6f 63 6b | 73 2e 7d 0d 09 20 0d 09 |ry block|s.}.. ..|
|00001cf0| 6b 4d 69 6e 53 70 61 63 | 65 09 3d 20 32 30 20 2a |kMinSpac|e.= 20 *|
|00001d00| 20 31 30 32 34 3b 0d 09 | 0d 09 7b 6b 45 78 74 72 | 1024;..|..{kExtr|
|00001d10| 65 6d 65 4e 65 67 20 61 | 6e 64 20 6b 45 78 74 72 |emeNeg a|nd kExtr|
|00001d20| 65 6d 65 50 6f 73 20 61 | 72 65 20 75 73 65 64 20 |emePos a|re used |
|00001d30| 74 6f 20 73 65 74 20 75 | 70 20 77 69 64 65 20 6f |to set u|p wide o|
|00001d40| 70 65 6e 20 72 65 63 74 | 61 6e 67 6c 65 73 20 61 |pen rect|angles a|
|00001d50| 6e 64 20 72 65 67 69 6f | 6e 73 2e 7d 0d 09 6b 45 |nd regio|ns.}..kE|
|00001d60| 78 74 72 65 6d 65 4e 65 | 67 09 09 3d 20 2d 33 32 |xtremeNe|g..= -32|
|00001d70| 37 36 38 3b 0d 09 6b 45 | 78 74 72 65 6d 65 50 6f |768;..kE|xtremePo|
|00001d80| 73 09 09 3d 20 33 32 37 | 36 37 20 2d 20 31 3b 09 |s..= 327|67 - 1;.|
|00001d90| 7b 72 65 71 75 69 72 65 | 64 20 66 6f 72 20 6f 6c |{require|d for ol|
|00001da0| 64 20 72 65 67 69 6f 6e | 20 62 75 67 7d 0d 09 0d |d region| bug}...|
|00001db0| 09 7b 6b 54 45 53 6c 6f | 70 20 70 72 6f 76 69 64 |.{kTESlo|p provid|
|00001dc0| 65 73 20 73 6f 6d 65 20 | 65 78 74 72 61 20 73 65 |es some |extra se|
|00001dd0| 63 75 72 69 74 79 20 77 | 68 65 6e 20 70 72 65 2d |curity w|hen pre-|
|00001de0| 66 6c 69 67 68 74 69 6e | 67 20 65 64 69 74 20 63 |flightin|g edit c|
|00001df0| 6f 6d 6d 61 6e 64 73 2e | 7d 0d 09 6b 54 45 53 6c |ommands.|}..kTESl|
|00001e00| 6f 70 09 09 09 3d 20 31 | 30 32 34 3b 0d 0d 09 7b |op...= 1|024;...{|
|00001e10| 6b 45 72 72 53 74 72 69 | 6e 67 73 20 69 73 20 74 |kErrStri|ngs is t|
|00001e20| 68 65 20 72 65 73 6f 75 | 72 63 65 20 49 44 20 66 |he resou|rce ID f|
|00001e30| 6f 72 20 74 68 65 20 65 | 72 72 6f 72 20 73 74 72 |or the e|rror str|
|00001e40| 69 6e 67 73 20 53 54 52 | 23 20 72 65 73 6f 75 72 |ings STR|# resour|
|00001e50| 63 65 2e 7d 0d 09 6b 45 | 72 72 53 74 72 69 6e 67 |ce.}..kE|rrString|
|00001e60| 73 09 09 3d 20 31 32 38 | 3b 0d 0d 09 7b 54 68 65 |s..= 128|;...{The|
|00001e70| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 61 72 65 20 69 | followi|ng are i|
|00001e80| 6e 64 69 63 69 65 73 20 | 69 6e 74 6f 20 53 54 52 |ndicies |into STR|
|00001e90| 23 20 72 65 73 6f 75 72 | 63 65 73 2e 7d 0d 09 65 |# resour|ces.}..e|
|00001ea0| 57 72 6f 6e 67 4d 61 63 | 68 69 6e 65 09 3d 20 31 |WrongMac|hine.= 1|
|00001eb0| 3b 0d 09 65 53 6d 61 6c | 6c 53 69 7a 65 09 09 3d |;..eSmal|lSize..=|
|00001ec0| 20 32 3b 0d 09 65 4e 6f | 4d 65 6d 6f 72 79 09 09 | 2;..eNo|Memory..|
|00001ed0| 3d 20 33 3b 0d 09 65 4e | 6f 53 70 61 63 65 43 75 |= 3;..eN|oSpaceCu|
|00001ee0| 74 09 09 3d 20 34 3b 0d | 09 65 4e 6f 43 75 74 09 |t..= 4;.|.eNoCut.|
|00001ef0| 09 09 3d 20 35 3b 0d 09 | 65 4e 6f 43 6f 70 79 09 |..= 5;..|eNoCopy.|
|00001f00| 09 09 3d 20 36 3b 0d 09 | 65 45 78 63 65 65 64 50 |..= 6;..|eExceedP|
|00001f10| 61 73 74 65 09 3d 20 37 | 3b 0d 09 65 4e 6f 53 70 |aste.= 7|;..eNoSp|
|00001f20| 61 63 65 50 61 73 74 65 | 09 3d 20 38 3b 0d 09 65 |acePaste|.= 8;..e|
|00001f30| 4e 6f 57 69 6e 64 6f 77 | 09 09 3d 20 39 3b 0d 09 |NoWindow|..= 9;..|
|00001f40| 65 45 78 63 65 65 64 43 | 68 61 72 09 09 3d 20 31 |eExceedC|har..= 1|
|00001f50| 30 3b 0d 09 65 4e 6f 50 | 61 73 74 65 09 09 3d 20 |0;..eNoP|aste..= |
|00001f60| 31 31 3b 0d 09 0d 09 7b | 54 68 65 20 66 6f 6c 6c |11;....{|The foll|
|00001f70| 6f 77 69 6e 67 20 63 6f | 6e 73 74 61 6e 74 73 20 |owing co|nstants |
|00001f80| 61 72 65 20 61 6c 6c 20 | 72 65 73 6f 75 72 63 65 |are all |resource|
|00001f90| 20 49 44 73 2c 20 63 6f | 72 72 65 73 70 6f 6e 64 | IDs, co|rrespond|
|00001fa0| 69 6e 67 20 74 6f 20 72 | 65 73 6f 75 72 63 65 73 |ing to r|esources|
|00001fb0| 20 69 6e 20 53 61 6d 70 | 6c 65 2e 72 2e 7d 0d 09 | in Samp|le.r.}..|
|00001fc0| 72 4d 65 6e 75 42 61 72 | 09 3d 20 31 32 38 3b 09 |rMenuBar|.= 128;.|
|00001fd0| 09 09 09 09 7b 61 70 70 | 6c 69 63 61 74 69 6f 6e |....{app|lication|
|00001fe0| 27 73 20 6d 65 6e 75 20 | 62 61 72 7d 0d 09 72 41 |'s menu |bar}..rA|
|00001ff0| 62 6f 75 74 41 6c 65 72 | 74 09 3d 20 31 32 38 3b |boutAler|t.= 128;|
|00002000| 09 09 09 09 09 7b 61 62 | 6f 75 74 20 61 6c 65 72 |.....{ab|out aler|
|00002010| 74 7d 0d 09 72 55 73 65 | 72 41 6c 65 72 74 09 3d |t}..rUse|rAlert.=|
|00002020| 20 31 32 39 3b 09 09 09 | 09 09 7b 75 73 65 72 20 | 129;...|..{user |
|00002030| 65 72 72 6f 72 20 61 6c | 65 72 74 7d 0d 09 72 44 |error al|ert}..rD|
|00002040| 6f 63 57 69 6e 64 6f 77 | 09 3d 20 31 32 38 3b 09 |ocWindow|.= 128;.|
|00002050| 09 09 09 09 7b 61 70 70 | 6c 69 63 61 74 69 6f 6e |....{app|lication|
|00002060| 27 73 20 77 69 6e 64 6f | 77 7d 0d 09 72 56 53 63 |'s windo|w}..rVSc|
|00002070| 72 6f 6c 6c 09 3d 20 31 | 32 38 3b 09 09 09 09 09 |roll.= 1|28;.....|
|00002080| 7b 76 65 72 74 69 63 61 | 6c 20 73 63 72 6f 6c 6c |{vertica|l scroll|
|00002090| 62 61 72 20 63 6f 6e 74 | 72 6f 6c 7d 0d 09 72 48 |bar cont|rol}..rH|
|000020a0| 53 63 72 6f 6c 6c 09 3d | 20 31 32 39 3b 09 09 09 |Scroll.=| 129;...|
|000020b0| 09 09 7b 68 6f 72 69 7a | 6f 6e 74 61 6c 20 73 63 |..{horiz|ontal sc|
|000020c0| 72 6f 6c 6c 62 61 72 20 | 63 6f 6e 74 72 6f 6c 7d |rollbar |control}|
|000020d0| 0d 0d 09 7b 54 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |...{The |followin|
|000020e0| 67 20 63 6f 6e 73 74 61 | 6e 74 73 20 61 72 65 20 |g consta|nts are |
|000020f0| 75 73 65 64 20 74 6f 20 | 69 64 65 6e 74 69 66 79 |used to |identify|
|00002100| 20 6d 65 6e 75 73 20 61 | 6e 64 20 74 68 65 69 72 | menus a|nd their|
|00002110| 20 69 74 65 6d 73 2e 20 | 54 68 65 20 6d 65 6e 75 | items. |The menu|
|00002120| 20 49 44 73 0d 09 20 68 | 61 76 65 20 61 6e 20 22 | IDs.. h|ave an "|
|00002130| 6d 22 20 70 72 65 66 69 | 78 20 61 6e 64 20 74 68 |m" prefi|x and th|
|00002140| 65 20 69 74 65 6d 20 6e | 75 6d 62 65 72 73 20 77 |e item n|umbers w|
|00002150| 69 74 68 69 6e 20 65 61 | 63 68 20 6d 65 6e 75 20 |ithin ea|ch menu |
|00002160| 68 61 76 65 20 61 6e 20 | 22 69 22 20 70 72 65 66 |have an |"i" pref|
|00002170| 69 78 2e 7d 0d 09 6d 41 | 70 70 6c 65 09 09 3d 20 |ix.}..mA|pple..= |
|00002180| 31 32 38 3b 09 09 09 09 | 09 7b 41 70 70 6c 65 20 |128;....|.{Apple |
|00002190| 6d 65 6e 75 7d 0d 09 69 | 41 62 6f 75 74 09 09 3d |menu}..i|About..=|
|000021a0| 20 31 3b 0d 0d 09 6d 46 | 69 6c 65 09 09 3d 20 31 | 1;...mF|ile..= 1|
|000021b0| 32 39 3b 09 09 09 09 09 | 7b 46 69 6c 65 20 6d 65 |29;.....|{File me|
|000021c0| 6e 75 7d 0d 09 69 4e 65 | 77 09 09 3d 20 31 3b 0d |nu}..iNe|w..= 1;.|
|000021d0| 09 69 43 6c 6f 73 65 09 | 09 3d 20 34 3b 0d 09 69 |.iClose.|.= 4;..i|
|000021e0| 51 75 69 74 09 09 3d 20 | 31 32 3b 0d 0d 09 6d 45 |Quit..= |12;...mE|
|000021f0| 64 69 74 09 09 3d 20 31 | 33 30 3b 09 09 09 09 09 |dit..= 1|30;.....|
|00002200| 7b 45 64 69 74 20 6d 65 | 6e 75 7d 0d 09 69 55 6e |{Edit me|nu}..iUn|
|00002210| 64 6f 09 09 3d 20 31 3b | 0d 09 69 43 75 74 09 09 |do..= 1;|..iCut..|
|00002220| 3d 20 33 3b 0d 09 69 43 | 6f 70 79 09 09 3d 20 34 |= 3;..iC|opy..= 4|
|00002230| 3b 0d 09 69 50 61 73 74 | 65 09 09 3d 20 35 3b 0d |;..iPast|e..= 5;.|
|00002240| 09 69 43 6c 65 61 72 09 | 09 3d 20 36 3b 0d 0d 09 |.iClear.|.= 6;...|
|00002250| 7b 31 2e 30 31 20 2d 20 | 6b 44 49 54 6f 70 20 61 |{1.01 - |kDITop a|
|00002260| 6e 64 20 6b 44 49 4c 65 | 66 74 20 61 72 65 20 75 |nd kDILe|ft are u|
|00002270| 73 65 64 20 74 6f 20 6c | 6f 63 61 74 65 20 74 68 |sed to l|ocate th|
|00002280| 65 20 44 69 73 6b 20 49 | 6e 69 74 69 61 6c 69 7a |e Disk I|nitializ|
|00002290| 61 74 69 6f 6e 20 64 69 | 61 6c 6f 67 73 2e 7d 0d |ation di|alogs.}.|
|000022a0| 09 6b 44 49 54 6f 70 09 | 09 3d 20 24 30 30 35 30 |.kDITop.|.= $0050|
|000022b0| 3b 0d 09 6b 44 49 4c 65 | 66 74 09 09 3d 20 24 30 |;..kDILe|ft..= $0|
|000022c0| 30 37 30 3b 0d 0d 0d 54 | 59 50 45 0d 09 7b 41 20 |070;...T|YPE..{A |
|000022d0| 44 6f 63 75 6d 65 6e 74 | 52 65 63 6f 72 64 20 63 |Document|Record c|
|000022e0| 6f 6e 74 61 69 6e 73 20 | 74 68 65 20 57 69 6e 64 |ontains |the Wind|
|000022f0| 6f 77 52 65 63 6f 72 64 | 20 66 6f 72 20 6f 6e 65 |owRecord| for one|
|00002300| 20 6f 66 20 6f 75 72 20 | 64 6f 63 75 6d 65 6e 74 | of our |document|
|00002310| 20 77 69 6e 64 6f 77 73 | 2c 0d 09 20 61 73 20 77 | windows|,.. as w|
|00002320| 65 6c 6c 20 61 73 20 74 | 68 65 20 54 45 48 61 6e |ell as t|he TEHan|
|00002330| 64 6c 65 20 66 6f 72 20 | 74 68 65 20 74 65 78 74 |dle for |the text|
|00002340| 20 77 65 20 61 72 65 20 | 65 64 69 74 69 6e 67 2e | we are |editing.|
|00002350| 20 57 65 20 68 61 76 65 | 20 61 64 64 65 64 20 66 | We have| added f|
|00002360| 69 65 6c 64 73 20 74 6f | 0d 09 20 68 6f 6c 64 20 |ields to|.. hold |
|00002370| 74 68 65 20 43 6f 6e 74 | 72 6f 6c 48 61 6e 64 6c |the Cont|rolHandl|
|00002380| 65 73 20 74 6f 20 74 68 | 65 20 76 65 72 74 69 63 |es to th|e vertic|
|00002390| 61 6c 20 61 6e 64 20 68 | 6f 72 69 7a 6f 6e 74 61 |al and h|orizonta|
|000023a0| 6c 20 73 63 72 6f 6c 6c | 62 61 72 73 20 61 6e 64 |l scroll|bars and|
|000023b0| 20 74 6f 20 68 6f 6c 64 | 0d 09 20 74 68 65 20 61 | to hold|.. the a|
|000023c0| 64 64 72 65 73 73 20 6f | 66 20 74 68 65 20 64 65 |ddress o|f the de|
|000023d0| 66 61 75 6c 74 20 63 6c | 69 6b 4c 6f 6f 70 20 74 |fault cl|ikLoop t|
|000023e0| 68 61 74 20 67 65 74 73 | 20 61 74 74 61 63 68 65 |hat gets| attache|
|000023f0| 64 20 74 6f 20 61 20 54 | 45 52 65 63 20 77 68 65 |d to a T|ERec whe|
|00002400| 6e 20 79 6f 75 20 63 61 | 6c 6c 0d 09 20 54 45 41 |n you ca|ll.. TEA|
|00002410| 75 74 6f 56 69 65 77 2e | 20 4f 74 68 65 72 20 64 |utoView.| Other d|
|00002420| 6f 63 75 6d 65 6e 74 20 | 66 69 65 6c 64 73 20 63 |ocument |fields c|
|00002430| 61 6e 20 62 65 20 61 64 | 64 65 64 20 74 6f 20 74 |an be ad|ded to t|
|00002440| 68 69 73 20 72 65 63 6f | 72 64 20 61 73 20 6e 65 |his reco|rd as ne|
|00002450| 65 64 65 64 2e 20 46 6f | 72 0d 09 20 61 20 73 69 |eded. Fo|r.. a si|
|00002460| 6d 69 6c 61 72 20 65 78 | 61 6d 70 6c 65 2c 20 73 |milar ex|ample, s|
|00002470| 65 65 20 68 6f 77 20 74 | 68 65 20 57 69 6e 64 6f |ee how t|he Windo|
|00002480| 77 20 4d 61 6e 61 67 65 | 72 20 61 6e 64 20 44 69 |w Manage|r and Di|
|00002490| 61 6c 6f 67 20 4d 61 6e | 61 67 65 72 20 61 64 64 |alog Man|ager add|
|000024a0| 20 66 69 65 6c 64 73 0d | 09 20 61 66 74 65 72 20 | fields.|. after |
|000024b0| 74 68 65 20 47 72 61 66 | 50 6f 72 74 2e 7d 0d 09 |the Graf|Port.}..|
|000024c0| 44 6f 63 75 6d 65 6e 74 | 52 65 63 6f 72 64 09 3d |Document|Record.=|
|000024d0| 20 52 45 43 4f 52 44 0d | 09 09 64 6f 63 57 69 6e | RECORD.|..docWin|
|000024e0| 64 6f 77 09 3a 20 57 69 | 6e 64 6f 77 52 65 63 6f |dow.: Wi|ndowReco|
|000024f0| 72 64 3b 0d 09 09 64 6f | 63 54 45 09 09 3a 20 54 |rd;...do|cTE..: T|
|00002500| 45 48 61 6e 64 6c 65 3b | 0d 09 09 64 6f 63 56 53 |EHandle;|...docVS|
|00002510| 63 72 6f 6c 6c 09 3a 20 | 43 6f 6e 74 72 6f 6c 48 |croll.: |ControlH|
|00002520| 61 6e 64 6c 65 3b 0d 09 | 09 64 6f 63 48 53 63 72 |andle;..|.docHScr|
|00002530| 6f 6c 6c 09 3a 20 43 6f | 6e 74 72 6f 6c 48 61 6e |oll.: Co|ntrolHan|
|00002540| 64 6c 65 3b 0d 09 09 64 | 6f 63 43 6c 69 6b 09 09 |dle;...d|ocClik..|
|00002550| 3a 20 50 72 6f 63 50 74 | 72 3b 0d 09 45 4e 44 3b |: ProcPt|r;..END;|
|00002560| 0d 09 44 6f 63 75 6d 65 | 6e 74 50 65 65 6b 09 3d |..Docume|ntPeek.=|
|00002570| 20 5e 44 6f 63 75 6d 65 | 6e 74 52 65 63 6f 72 64 | ^Docume|ntRecord|
|00002580| 3b 0d 0d 0d 56 41 52 0d | 09 7b 54 68 65 20 22 67 |;...VAR.|.{The "g|
|00002590| 22 20 70 72 65 66 69 78 | 20 69 73 20 75 73 65 64 |" prefix| is used|
|000025a0| 20 74 6f 20 65 6d 70 68 | 61 73 69 7a 65 20 74 68 | to emph|asize th|
|000025b0| 61 74 20 61 20 76 61 72 | 69 61 62 6c 65 20 69 73 |at a var|iable is|
|000025c0| 20 67 6c 6f 62 61 6c 2e | 7d 0d 0d 09 7b 47 4d 61 | global.|}...{GMa|
|000025d0| 63 20 69 73 20 75 73 65 | 64 20 74 6f 20 68 6f 6c |c is use|d to hol|
|000025e0| 64 20 74 68 65 20 72 65 | 73 75 6c 74 20 6f 66 20 |d the re|sult of |
|000025f0| 61 20 53 79 73 45 6e 76 | 69 72 6f 6e 73 20 63 61 |a SysEnv|irons ca|
|00002600| 6c 6c 2e 20 54 68 69 73 | 20 6d 61 6b 65 73 0d 09 |ll. This| makes..|
|00002610| 20 69 74 20 63 6f 6e 76 | 65 6e 69 65 6e 74 20 66 | it conv|enient f|
|00002620| 6f 72 20 61 6e 79 20 72 | 6f 75 74 69 6e 65 20 74 |or any r|outine t|
|00002630| 6f 20 63 68 65 63 6b 20 | 74 68 65 20 65 6e 76 69 |o check |the envi|
|00002640| 72 6f 6e 6d 65 6e 74 2e | 20 49 74 20 69 73 0d 09 |ronment.| It is..|
|00002650| 20 67 6c 6f 62 61 6c 20 | 69 6e 66 6f 72 6d 61 74 | global |informat|
|00002660| 69 6f 6e 2c 20 61 6e 79 | 77 61 79 2e 7d 0d 09 67 |ion, any|way.}..g|
|00002670| 4d 61 63 09 09 09 09 3a | 20 53 79 73 45 6e 76 52 |Mac....:| SysEnvR|
|00002680| 65 63 3b 09 7b 73 65 74 | 20 75 70 20 62 79 20 49 |ec;.{set| up by I|
|00002690| 6e 69 74 69 61 6c 69 7a | 65 7d 0d 0d 09 7b 47 48 |nitializ|e}...{GH|
|000026a0| 61 73 57 61 69 74 4e 65 | 78 74 45 76 65 6e 74 20 |asWaitNe|xtEvent |
|000026b0| 69 73 20 73 65 74 20 61 | 74 20 73 74 61 72 74 75 |is set a|t startu|
|000026c0| 70 2c 20 61 6e 64 20 74 | 65 6c 6c 73 20 77 68 65 |p, and t|ells whe|
|000026d0| 74 68 65 72 20 74 68 65 | 20 57 61 69 74 4e 65 78 |ther the| WaitNex|
|000026e0| 74 45 76 65 6e 74 0d 09 | 20 74 72 61 70 20 69 73 |tEvent..| trap is|
|000026f0| 20 61 76 61 69 6c 61 62 | 6c 65 2e 20 49 66 20 69 | availab|le. If i|
|00002700| 74 20 69 73 20 66 61 6c | 73 65 2c 20 77 65 20 6b |t is fal|se, we k|
|00002710| 6e 6f 77 20 74 68 61 74 | 20 77 65 20 6d 75 73 74 |now that| we must|
|00002720| 20 63 61 6c 6c 20 47 65 | 74 4e 65 78 74 45 76 65 | call Ge|tNextEve|
|00002730| 6e 74 2e 7d 0d 09 67 48 | 61 73 57 61 69 74 4e 65 |nt.}..gH|asWaitNe|
|00002740| 78 74 45 76 65 6e 74 09 | 3a 20 42 4f 4f 4c 45 41 |xtEvent.|: BOOLEA|
|00002750| 4e 3b 09 09 7b 73 65 74 | 20 75 70 20 62 79 20 49 |N;..{set| up by I|
|00002760| 6e 69 74 69 61 6c 69 7a | 65 7d 0d 0d 09 7b 47 49 |nitializ|e}...{GI|
|00002770| 6e 42 61 63 6b 67 72 6f | 75 6e 64 20 69 73 20 6d |nBackgro|und is m|
|00002780| 61 69 6e 74 61 69 6e 65 | 64 20 62 79 20 6f 75 72 |aintaine|d by our|
|00002790| 20 4f 53 45 76 65 6e 74 | 20 68 61 6e 64 6c 69 6e | OSEvent| handlin|
|000027a0| 67 20 72 6f 75 74 69 6e | 65 73 2e 20 41 6e 79 20 |g routin|es. Any |
|000027b0| 70 61 72 74 20 6f 66 0d | 09 20 74 68 65 20 70 72 |part of.|. the pr|
|000027c0| 6f 67 72 61 6d 20 63 61 | 6e 20 63 68 65 63 6b 20 |ogram ca|n check |
|000027d0| 69 74 20 74 6f 20 66 69 | 6e 64 20 6f 75 74 20 69 |it to fi|nd out i|
|000027e0| 66 20 69 74 20 69 73 20 | 63 75 72 72 65 6e 74 6c |f it is |currentl|
|000027f0| 79 20 69 6e 20 74 68 65 | 20 62 61 63 6b 67 72 6f |y in the| backgro|
|00002800| 75 6e 64 2e 7d 0d 09 67 | 49 6e 42 61 63 6b 67 72 |und.}..g|InBackgr|
|00002810| 6f 75 6e 64 09 09 3a 20 | 42 4f 4f 4c 45 41 4e 3b |ound..: |BOOLEAN;|
|00002820| 09 09 7b 6d 61 69 6e 74 | 61 69 6e 65 64 20 62 79 |..{maint|ained by|
|00002830| 20 49 6e 69 74 69 61 6c | 69 7a 65 20 61 6e 64 20 | Initial|ize and |
|00002840| 44 6f 45 76 65 6e 74 7d | 0d 0d 09 7b 47 4e 75 6d |DoEvent}|...{GNum|
|00002850| 44 6f 63 75 6d 65 6e 74 | 73 20 69 73 20 75 73 65 |Document|s is use|
|00002860| 64 20 74 6f 20 6b 65 65 | 70 20 74 72 61 63 6b 20 |d to kee|p track |
|00002870| 6f 66 20 68 6f 77 20 6d | 61 6e 79 20 6f 70 65 6e |of how m|any open|
|00002880| 20 64 6f 63 75 6d 65 6e | 74 73 20 74 68 65 72 65 | documen|ts there|
|00002890| 20 61 72 65 0d 09 20 61 | 74 20 61 6e 79 20 74 69 | are.. a|t any ti|
|000028a0| 6d 65 2e 20 49 74 20 69 | 73 20 6d 61 69 6e 74 61 |me. It i|s mainta|
|000028b0| 69 6e 65 64 20 62 79 20 | 74 68 65 20 72 6f 75 74 |ined by |the rout|
|000028c0| 69 6e 65 73 20 74 68 61 | 74 20 6f 70 65 6e 20 61 |ines tha|t open a|
|000028d0| 6e 64 20 63 6c 6f 73 65 | 20 64 6f 63 75 6d 65 6e |nd close| documen|
|000028e0| 74 73 2e 7d 0d 09 67 4e | 75 6d 44 6f 63 75 6d 65 |ts.}..gN|umDocume|
|000028f0| 6e 74 73 09 09 3a 20 49 | 4e 54 45 47 45 52 3b 09 |nts..: I|NTEGER;.|
|00002900| 09 7b 6d 61 69 6e 74 61 | 69 6e 65 64 20 62 79 20 |.{mainta|ined by |
|00002910| 49 6e 69 74 69 61 6c 69 | 7a 65 2c 20 44 6f 4e 65 |Initiali|ze, DoNe|
|00002920| 77 2c 20 61 6e 64 20 44 | 6f 43 6c 6f 73 65 57 69 |w, and D|oCloseWi|
|00002930| 6e 64 6f 77 7d 0d 0d 09 | 0d 7b 24 53 20 49 6e 69 |ndow}...|.{$S Ini|
|00002940| 74 69 61 6c 69 7a 65 7d | 0d 46 55 4e 43 54 49 4f |tialize}|.FUNCTIO|
|00002950| 4e 20 54 72 61 70 41 76 | 61 69 6c 61 62 6c 65 28 |N TrapAv|ailable(|
|00002960| 74 4e 75 6d 62 65 72 3a | 20 49 4e 54 45 47 45 52 |tNumber:| INTEGER|
|00002970| 3b 20 74 54 79 70 65 3a | 20 54 72 61 70 54 79 70 |; tType:| TrapTyp|
|00002980| 65 29 3a 20 42 4f 4f 4c | 45 41 4e 3b 0d 0d 7b 43 |e): BOOL|EAN;..{C|
|00002990| 68 65 63 6b 20 74 6f 20 | 73 65 65 20 69 66 20 61 |heck to |see if a|
|000029a0| 20 67 69 76 65 6e 20 74 | 72 61 70 20 69 73 20 69 | given t|rap is i|
|000029b0| 6d 70 6c 65 6d 65 6e 74 | 65 64 2e 20 54 68 69 73 |mplement|ed. This|
|000029c0| 20 69 73 20 6f 6e 6c 79 | 20 75 73 65 64 20 62 79 | is only| used by|
|000029d0| 20 74 68 65 0d 20 49 6e | 69 74 69 61 6c 69 7a 65 | the. In|itialize|
|000029e0| 20 72 6f 75 74 69 6e 65 | 20 69 6e 20 74 68 69 73 | routine| in this|
|000029f0| 20 70 72 6f 67 72 61 6d | 2c 20 73 6f 20 77 65 20 | program|, so we |
|00002a00| 70 75 74 20 69 74 20 69 | 6e 20 74 68 65 20 49 6e |put it i|n the In|
|00002a10| 69 74 69 61 6c 69 7a 65 | 20 73 65 67 6d 65 6e 74 |itialize| segment|
|00002a20| 2e 0d 20 54 68 65 20 72 | 65 63 6f 6d 6d 65 6e 64 |.. The r|ecommend|
|00002a30| 65 64 20 61 70 70 72 6f | 61 63 68 20 74 6f 20 73 |ed appro|ach to s|
|00002a40| 65 65 20 69 66 20 61 20 | 74 72 61 70 20 69 73 20 |ee if a |trap is |
|00002a50| 69 6d 70 6c 65 6d 65 6e | 74 65 64 20 69 73 20 74 |implemen|ted is t|
|00002a60| 6f 20 73 65 65 20 69 66 | 0d 20 74 68 65 20 61 64 |o see if|. the ad|
|00002a70| 64 72 65 73 73 20 6f 66 | 20 74 68 65 20 74 72 61 |dress of| the tra|
|00002a80| 70 20 72 6f 75 74 69 6e | 65 20 69 73 20 74 68 65 |p routin|e is the|
|00002a90| 20 73 61 6d 65 20 61 73 | 20 74 68 65 20 61 64 64 | same as| the add|
|00002aa0| 72 65 73 73 20 6f 66 20 | 74 68 65 0d 20 55 6e 69 |ress of |the. Uni|
|00002ab0| 6d 70 6c 65 6d 65 6e 74 | 65 64 20 74 72 61 70 2e |mplement|ed trap.|
|00002ac0| 7d 0d 7b 31 2e 30 32 20 | 2d 20 4e 65 65 64 73 20 |}.{1.02 |- Needs |
|00002ad0| 74 6f 20 62 65 20 63 61 | 6c 6c 65 64 20 61 66 74 |to be ca|lled aft|
|00002ae0| 65 72 20 63 61 6c 6c 20 | 74 6f 20 53 79 73 45 6e |er call |to SysEn|
|00002af0| 76 69 72 6f 6e 73 20 73 | 6f 20 74 68 61 74 20 69 |virons s|o that i|
|00002b00| 74 20 63 61 6e 20 63 68 | 65 63 6b 0d 20 69 66 20 |t can ch|eck. if |
|00002b10| 61 20 54 6f 6f 6c 54 72 | 61 70 20 69 73 20 6f 75 |a ToolTr|ap is ou|
|00002b20| 74 20 6f 66 20 72 61 6e | 67 65 20 6f 66 20 61 20 |t of ran|ge of a |
|00002b30| 70 72 65 2d 4d 61 63 49 | 49 20 52 4f 4d 2e 7d 0d |pre-MacI|I ROM.}.|
|00002b40| 0d 42 45 47 49 4e 0d 09 | 49 46 20 28 74 54 79 70 |.BEGIN..|IF (tTyp|
|00002b50| 65 20 3d 20 54 6f 6f 6c | 54 72 61 70 29 20 26 0d |e = Tool|Trap) &.|
|00002b60| 09 09 28 67 4d 61 63 2e | 6d 61 63 68 69 6e 65 54 |..(gMac.|machineT|
|00002b70| 79 70 65 20 3e 20 65 6e | 76 4d 61 63 68 55 6e 6b |ype > en|vMachUnk|
|00002b80| 6e 6f 77 6e 29 20 26 0d | 09 09 28 67 4d 61 63 2e |nown) &.|..(gMac.|
|00002b90| 6d 61 63 68 69 6e 65 54 | 79 70 65 20 3c 20 65 6e |machineT|ype < en|
|00002ba0| 76 4d 61 63 49 49 29 20 | 54 48 45 4e 20 42 45 47 |vMacII) |THEN BEG|
|00002bb0| 49 4e 09 09 7b 69 74 27 | 73 20 61 20 35 31 32 4b |IN..{it'|s a 512K|
|00002bc0| 45 2c 20 50 6c 75 73 2c | 20 6f 72 20 53 45 7d 0d |E, Plus,| or SE}.|
|00002bd0| 09 09 74 4e 75 6d 62 65 | 72 20 3a 3d 20 42 41 4e |..tNumbe|r := BAN|
|00002be0| 44 28 74 4e 75 6d 62 65 | 72 2c 20 24 30 33 46 46 |D(tNumbe|r, $03FF|
|00002bf0| 29 3b 0d 09 09 49 46 20 | 74 4e 75 6d 62 65 72 20 |);...IF |tNumber |
|00002c00| 3e 20 24 30 31 46 46 20 | 54 48 45 4e 09 09 09 09 |> $01FF |THEN....|
|00002c10| 09 09 09 7b 77 68 69 63 | 68 20 6d 65 61 6e 73 20 |...{whic|h means |
|00002c20| 74 68 65 20 74 6f 6f 6c | 20 74 72 61 70 73 7d 0d |the tool| traps}.|
|00002c30| 09 09 09 74 4e 75 6d 62 | 65 72 20 3a 3d 20 5f 55 |...tNumb|er := _U|
|00002c40| 6e 69 6d 70 6c 65 6d 65 | 6e 74 65 64 3b 09 09 09 |nimpleme|nted;...|
|00002c50| 09 09 7b 6f 6e 6c 79 20 | 67 6f 20 74 6f 20 24 30 |..{only |go to $0|
|00002c60| 31 46 46 7d 0d 09 45 4e | 44 3b 0d 09 54 72 61 70 |1FF}..EN|D;..Trap|
|00002c70| 41 76 61 69 6c 61 62 6c | 65 20 3a 3d 20 4e 47 65 |Availabl|e := NGe|
|00002c80| 74 54 72 61 70 41 64 64 | 72 65 73 73 28 74 4e 75 |tTrapAdd|ress(tNu|
|00002c90| 6d 62 65 72 2c 20 74 54 | 79 70 65 29 20 3c 3e 0d |mber, tT|ype) <>.|
|00002ca0| 09 09 09 09 09 09 47 65 | 74 54 72 61 70 41 64 64 |......Ge|tTrapAdd|
|00002cb0| 72 65 73 73 28 5f 55 6e | 69 6d 70 6c 65 6d 65 6e |ress(_Un|implemen|
|00002cc0| 74 65 64 29 3b 0d 45 4e | 44 3b 20 7b 54 72 61 70 |ted);.EN|D; {Trap|
|00002cd0| 41 76 61 69 6c 61 62 6c | 65 7d 0d 0d 0d 7b 24 53 |Availabl|e}...{$S|
|00002ce0| 20 4d 61 69 6e 7d 0d 46 | 55 4e 43 54 49 4f 4e 20 | Main}.F|UNCTION |
|00002cf0| 49 73 44 41 57 69 6e 64 | 6f 77 28 77 69 6e 64 6f |IsDAWind|ow(windo|
|00002d00| 77 3a 20 57 69 6e 64 6f | 77 50 74 72 29 3a 20 42 |w: Windo|wPtr): B|
|00002d10| 4f 4f 4c 45 41 4e 3b 0d | 0d 7b 43 68 65 63 6b 20 |OOLEAN;.|.{Check |
|00002d20| 69 66 20 61 20 77 69 6e | 64 6f 77 20 62 65 6c 6f |if a win|dow belo|
|00002d30| 6e 67 73 20 74 6f 20 61 | 20 64 65 73 6b 20 61 63 |ngs to a| desk ac|
|00002d40| 63 65 73 73 6f 72 79 2e | 7d 0d 0d 42 45 47 49 4e |cessory.|}..BEGIN|
|00002d50| 0d 09 49 46 20 77 69 6e | 64 6f 77 20 3d 20 4e 49 |..IF win|dow = NI|
|00002d60| 4c 20 54 48 45 4e 0d 09 | 09 49 73 44 41 57 69 6e |L THEN..|.IsDAWin|
|00002d70| 64 6f 77 20 3a 3d 20 46 | 41 4c 53 45 0d 09 45 4c |dow := F|ALSE..EL|
|00002d80| 53 45 09 7b 44 41 20 77 | 69 6e 64 6f 77 73 20 68 |SE.{DA w|indows h|
|00002d90| 61 76 65 20 6e 65 67 61 | 74 69 76 65 20 77 69 6e |ave nega|tive win|
|00002da0| 64 6f 77 4b 69 6e 64 73 | 7d 0d 09 09 49 73 44 41 |dowKinds|}...IsDA|
|00002db0| 57 69 6e 64 6f 77 20 3a | 3d 20 57 69 6e 64 6f 77 |Window :|= Window|
|00002dc0| 50 65 65 6b 28 77 69 6e | 64 6f 77 29 5e 2e 77 69 |Peek(win|dow)^.wi|
|00002dd0| 6e 64 6f 77 4b 69 6e 64 | 20 3c 20 30 3b 0d 45 4e |ndowKind| < 0;.EN|
|00002de0| 44 3b 20 7b 49 73 44 41 | 57 69 6e 64 6f 77 7d 0d |D; {IsDA|Window}.|
|00002df0| 0d 0d 7b 24 53 20 4d 61 | 69 6e 7d 0d 46 55 4e 43 |..{$S Ma|in}.FUNC|
|00002e00| 54 49 4f 4e 20 49 73 41 | 70 70 57 69 6e 64 6f 77 |TION IsA|ppWindow|
|00002e10| 28 77 69 6e 64 6f 77 3a | 20 57 69 6e 64 6f 77 50 |(window:| WindowP|
|00002e20| 74 72 29 3a 20 42 4f 4f | 4c 45 41 4e 3b 0d 0d 7b |tr): BOO|LEAN;..{|
|00002e30| 43 68 65 63 6b 20 74 6f | 20 73 65 65 20 69 66 20 |Check to| see if |
|00002e40| 61 20 77 69 6e 64 6f 77 | 20 62 65 6c 6f 6e 67 73 |a window| belongs|
|00002e50| 20 74 6f 20 74 68 65 20 | 61 70 70 6c 69 63 61 74 | to the |applicat|
|00002e60| 69 6f 6e 2e 20 49 66 20 | 74 68 65 20 77 69 6e 64 |ion. If |the wind|
|00002e70| 6f 77 20 70 6f 69 6e 74 | 65 72 0d 20 70 61 73 73 |ow point|er. pass|
|00002e80| 65 64 20 77 61 73 20 4e | 49 4c 2c 20 74 68 65 6e |ed was N|IL, then|
|00002e90| 20 69 74 20 63 6f 75 6c | 64 20 6e 6f 74 20 62 65 | it coul|d not be|
|00002ea0| 20 61 6e 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 | an appl|ication |
|00002eb0| 77 69 6e 64 6f 77 2e 20 | 57 69 6e 64 6f 77 4b 69 |window. |WindowKi|
|00002ec0| 6e 64 73 0d 20 74 68 61 | 74 20 61 72 65 20 6e 65 |nds. tha|t are ne|
|00002ed0| 67 61 74 69 76 65 20 62 | 65 6c 6f 6e 67 20 74 6f |gative b|elong to|
|00002ee0| 20 74 68 65 20 73 79 73 | 74 65 6d 20 61 6e 64 20 | the sys|tem and |
|00002ef0| 77 69 6e 64 6f 77 4b 69 | 6e 64 73 20 6c 65 73 73 |windowKi|nds less|
|00002f00| 20 74 68 61 6e 20 75 73 | 65 72 4b 69 6e 64 0d 20 | than us|erKind. |
|00002f10| 61 72 65 20 72 65 73 65 | 72 76 65 64 20 62 79 20 |are rese|rved by |
|00002f20| 41 70 70 6c 65 20 65 78 | 63 65 70 74 20 66 6f 72 |Apple ex|cept for|
|00002f30| 20 77 69 6e 64 6f 77 4b | 69 6e 64 73 20 65 71 75 | windowK|inds equ|
|00002f40| 61 6c 20 74 6f 20 64 69 | 61 6c 6f 67 4b 69 6e 64 |al to di|alogKind|
|00002f50| 2c 20 77 68 69 63 68 0d | 20 6d 65 61 6e 20 69 74 |, which.| mean it|
|00002f60| 20 69 73 20 61 20 64 69 | 61 6c 6f 67 2e 0d 20 31 | is a di|alog.. 1|
|00002f70| 2e 30 32 20 2d 20 49 6e | 20 6f 72 64 65 72 20 74 |.02 - In| order t|
|00002f80| 6f 20 72 65 64 75 63 65 | 20 74 68 65 20 63 68 61 |o reduce| the cha|
|00002f90| 6e 63 65 20 6f 66 20 61 | 63 63 69 64 65 6e 74 61 |nce of a|ccidenta|
|00002fa0| 6c 6c 79 20 74 72 65 61 | 74 69 6e 67 20 73 6f 6d |lly trea|ting som|
|00002fb0| 65 20 77 69 6e 64 6f 77 | 0d 20 61 73 20 61 6e 20 |e window|. as an |
|00002fc0| 41 70 70 57 69 6e 64 6f | 77 20 74 68 61 74 20 73 |AppWindo|w that s|
|00002fd0| 68 6f 75 6c 64 6e 27 74 | 20 62 65 2c 20 77 65 27 |houldn't| be, we'|
|00002fe0| 6c 6c 20 6f 6e 6c 79 20 | 72 65 74 75 72 6e 20 74 |ll only |return t|
|00002ff0| 72 75 65 20 69 66 20 74 | 68 65 20 77 69 6e 64 6f |rue if t|he windo|
|00003000| 77 6b 69 6e 64 0d 20 69 | 73 20 75 73 65 72 4b 69 |wkind. i|s userKi|
|00003010| 6e 64 2e 20 49 66 20 79 | 6f 75 20 61 64 64 20 64 |nd. If y|ou add d|
|00003020| 69 66 66 65 72 65 6e 74 | 20 6b 69 6e 64 73 20 6f |ifferent| kinds o|
|00003030| 66 20 77 69 6e 64 6f 77 | 73 20 74 6f 20 53 61 6d |f window|s to Sam|
|00003040| 70 6c 65 20 79 6f 75 27 | 6c 6c 20 6e 65 65 64 0d |ple you'|ll need.|
|00003050| 20 74 6f 20 63 68 61 6e | 67 65 20 68 6f 77 20 74 | to chan|ge how t|
|00003060| 68 69 73 20 61 6c 6c 20 | 77 6f 72 6b 73 2e 7d 0d |his all |works.}.|
|00003070| 0d 42 45 47 49 4e 0d 09 | 49 46 20 77 69 6e 64 6f |.BEGIN..|IF windo|
|00003080| 77 20 3d 20 4e 49 4c 20 | 54 48 45 4e 0d 09 09 49 |w = NIL |THEN...I|
|00003090| 73 41 70 70 57 69 6e 64 | 6f 77 20 3a 3d 20 46 41 |sAppWind|ow := FA|
|000030a0| 4c 53 45 0d 09 45 4c 53 | 45 09 7b 61 70 70 6c 69 |LSE..ELS|E.{appli|
|000030b0| 63 61 74 69 6f 6e 20 77 | 69 6e 64 6f 77 73 20 68 |cation w|indows h|
|000030c0| 61 76 65 20 77 69 6e 64 | 6f 77 4b 69 6e 64 73 20 |ave wind|owKinds |
|000030d0| 3d 20 75 73 65 72 4b 69 | 6e 64 20 28 38 29 7d 0d |= userKi|nd (8)}.|
|000030e0| 09 09 57 49 54 48 20 57 | 69 6e 64 6f 77 50 65 65 |..WITH W|indowPee|
|000030f0| 6b 28 77 69 6e 64 6f 77 | 29 5e 20 44 4f 0d 09 09 |k(window|)^ DO...|
|00003100| 09 49 73 41 70 70 57 69 | 6e 64 6f 77 20 3a 3d 20 |.IsAppWi|ndow := |
|00003110| 28 77 69 6e 64 6f 77 4b | 69 6e 64 20 3d 20 75 73 |(windowK|ind = us|
|00003120| 65 72 4b 69 6e 64 29 3b | 0d 45 4e 44 3b 20 7b 49 |erKind);|.END; {I|
|00003130| 73 41 70 70 57 69 6e 64 | 6f 77 7d 0d 0d 0d 7b 24 |sAppWind|ow}...{$|
|00003140| 53 20 4d 61 69 6e 7d 0d | 50 52 4f 43 45 44 55 52 |S Main}.|PROCEDUR|
|00003150| 45 20 41 6c 65 72 74 55 | 73 65 72 28 65 72 72 6f |E AlertU|ser(erro|
|00003160| 72 3a 20 49 4e 54 45 47 | 45 52 29 3b 0d 0d 7b 44 |r: INTEG|ER);..{D|
|00003170| 69 73 70 6c 61 79 20 61 | 6e 20 61 6c 65 72 74 20 |isplay a|n alert |
|00003180| 74 68 61 74 20 74 65 6c | 6c 73 20 74 68 65 20 75 |that tel|ls the u|
|00003190| 73 65 72 20 61 6e 20 65 | 72 72 6f 72 20 6f 63 63 |ser an e|rror occ|
|000031a0| 75 72 72 65 64 2c 20 74 | 68 65 6e 20 65 78 69 74 |urred, t|hen exit|
|000031b0| 20 74 68 65 20 70 72 6f | 67 72 61 6d 2e 0d 20 54 | the pro|gram.. T|
|000031c0| 68 69 73 20 72 6f 75 74 | 69 6e 65 20 69 73 20 75 |his rout|ine is u|
|000031d0| 73 65 64 20 61 73 20 61 | 6e 20 75 6c 74 69 6d 61 |sed as a|n ultima|
|000031e0| 74 65 20 62 61 69 6c 2d | 6f 75 74 20 66 6f 72 20 |te bail-|out for |
|000031f0| 73 65 72 69 6f 75 73 20 | 65 72 72 6f 72 73 20 74 |serious |errors t|
|00003200| 68 61 74 20 70 72 6f 68 | 69 62 69 74 0d 20 74 68 |hat proh|ibit. th|
|00003210| 65 20 63 6f 6e 74 69 6e | 75 61 74 69 6f 6e 20 6f |e contin|uation o|
|00003220| 66 20 74 68 65 20 61 70 | 70 6c 69 63 61 74 69 6f |f the ap|plicatio|
|00003230| 6e 2e 20 45 72 72 6f 72 | 73 20 74 68 61 74 20 64 |n. Error|s that d|
|00003240| 6f 20 6e 6f 74 20 72 65 | 71 75 69 72 65 20 74 68 |o not re|quire th|
|00003250| 65 20 74 65 72 6d 69 6e | 61 74 69 6f 6e 0d 20 6f |e termin|ation. o|
|00003260| 66 20 74 68 65 20 61 70 | 70 6c 69 63 61 74 69 6f |f the ap|plicatio|
|00003270| 6e 20 73 68 6f 75 6c 64 | 20 62 65 20 68 61 6e 64 |n should| be hand|
|00003280| 6c 65 64 20 69 6e 20 61 | 20 64 69 66 66 65 72 65 |led in a| differe|
|00003290| 6e 74 20 6d 61 6e 6e 65 | 72 2e 20 45 72 72 6f 72 |nt manne|r. Error|
|000032a0| 20 63 68 65 63 6b 69 6e | 67 20 61 6e 64 0d 20 72 | checkin|g and. r|
|000032b0| 65 70 6f 72 74 69 6e 67 | 20 68 61 73 20 61 20 70 |eporting| has a p|
|000032c0| 6c 61 63 65 20 65 76 65 | 6e 20 69 6e 20 74 68 65 |lace eve|n in the|
|000032d0| 20 73 69 6d 70 6c 65 73 | 74 20 61 70 70 6c 69 63 | simples|t applic|
|000032e0| 61 74 69 6f 6e 2e 20 54 | 68 65 20 65 72 72 6f 72 |ation. T|he error|
|000032f0| 20 6e 75 6d 62 65 72 20 | 69 73 20 75 73 65 64 0d | number |is used.|
|00003300| 20 74 6f 20 69 6e 64 65 | 78 20 61 6e 20 27 53 54 | to inde|x an 'ST|
|00003310| 52 23 27 20 72 65 73 6f | 75 72 63 65 20 73 6f 20 |R#' reso|urce so |
|00003320| 74 68 61 74 20 61 20 72 | 65 6c 65 76 61 6e 74 20 |that a r|elevant |
|00003330| 6d 65 73 73 61 67 65 20 | 63 61 6e 20 62 65 20 64 |message |can be d|
|00003340| 69 73 70 6c 61 79 65 64 | 2e 7d 0d 20 0d 56 41 52 |isplayed|.}. .VAR|
|00003350| 0d 09 69 74 65 6d 48 69 | 74 09 3a 20 49 4e 54 45 |..itemHi|t.: INTE|
|00003360| 47 45 52 3b 0d 09 6d 65 | 73 73 61 67 65 09 3a 20 |GER;..me|ssage.: |
|00003370| 53 74 72 32 35 35 3b 0d | 42 45 47 49 4e 0d 09 53 |Str255;.|BEGIN..S|
|00003380| 65 74 43 75 72 73 6f 72 | 28 61 72 72 6f 77 29 3b |etCursor|(arrow);|
|00003390| 0d 09 47 65 74 49 6e 64 | 53 74 72 69 6e 67 28 6d |..GetInd|String(m|
|000033a0| 65 73 73 61 67 65 2c 20 | 6b 45 72 72 53 74 72 69 |essage, |kErrStri|
|000033b0| 6e 67 73 2c 20 65 72 72 | 6f 72 29 3b 0d 09 50 61 |ngs, err|or);..Pa|
|000033c0| 72 61 6d 54 65 78 74 28 | 6d 65 73 73 61 67 65 2c |ramText(|message,|
|000033d0| 20 27 27 2c 20 27 27 2c | 20 27 27 29 3b 0d 09 69 | '', '',| '');..i|
|000033e0| 74 65 6d 48 69 74 20 3a | 3d 20 41 6c 65 72 74 28 |temHit :|= Alert(|
|000033f0| 72 55 73 65 72 41 6c 65 | 72 74 2c 20 4e 49 4c 29 |rUserAle|rt, NIL)|
|00003400| 3b 0d 45 4e 44 3b 20 7b | 41 6c 65 72 74 55 73 65 |;.END; {|AlertUse|
|00003410| 72 7d 0d 0d 0d 7b 24 53 | 20 4d 61 69 6e 7d 0d 50 |r}...{$S| Main}.P|
|00003420| 52 4f 43 45 44 55 52 45 | 20 47 65 74 54 45 52 65 |ROCEDURE| GetTERe|
|00003430| 63 74 28 77 69 6e 64 6f | 77 3a 20 57 69 6e 64 6f |ct(windo|w: Windo|
|00003440| 77 50 74 72 3b 20 56 41 | 52 20 74 65 52 65 63 74 |wPtr; VA|R teRect|
|00003450| 3a 20 52 65 63 74 29 3b | 0d 0d 7b 72 65 74 75 72 |: Rect);|..{retur|
|00003460| 6e 20 61 20 72 65 63 74 | 61 6e 67 6c 65 20 74 68 |n a rect|angle th|
|00003470| 61 74 20 69 73 20 69 6e | 73 65 74 20 66 72 6f 6d |at is in|set from|
|00003480| 20 74 68 65 20 70 6f 72 | 74 52 65 63 74 20 62 79 | the por|tRect by|
|00003490| 20 74 68 65 20 73 69 7a | 65 20 6f 66 0d 74 68 65 | the siz|e of.the|
|000034a0| 20 73 63 72 6f 6c 6c 62 | 61 72 73 20 61 6e 64 20 | scrollb|ars and |
|000034b0| 61 20 6c 69 74 74 6c 65 | 20 65 78 74 72 61 20 6d |a little| extra m|
|000034c0| 61 72 67 69 6e 2e 7d 0d | 0d 42 45 47 49 4e 0d 09 |argin.}.|.BEGIN..|
|000034d0| 74 65 52 65 63 74 20 3a | 3d 20 77 69 6e 64 6f 77 |teRect :|= window|
|000034e0| 5e 2e 70 6f 72 74 52 65 | 63 74 3b 0d 09 49 6e 73 |^.portRe|ct;..Ins|
|000034f0| 65 74 52 65 63 74 28 74 | 65 52 65 63 74 2c 20 6b |etRect(t|eRect, k|
|00003500| 54 65 78 74 4d 61 72 67 | 69 6e 2c 20 6b 54 65 78 |TextMarg|in, kTex|
|00003510| 74 4d 61 72 67 69 6e 29 | 3b 09 09 09 7b 61 64 6a |tMargin)|;...{adj|
|00003520| 75 73 74 20 66 6f 72 20 | 6d 61 72 67 69 6e 7d 0d |ust for |margin}.|
|00003530| 09 74 65 52 65 63 74 2e | 62 6f 74 74 6f 6d 20 3a |.teRect.|bottom :|
|00003540| 3d 20 74 65 52 65 63 74 | 2e 62 6f 74 74 6f 6d 20 |= teRect|.bottom |
|00003550| 2d 20 6b 53 63 72 6f 6c | 6c 62 61 72 41 64 6a 75 |- kScrol|lbarAdju|
|00003560| 73 74 3b 09 7b 61 6e 64 | 20 66 6f 72 20 74 68 65 |st;.{and| for the|
|00003570| 20 73 63 72 6f 6c 6c 62 | 61 72 73 7d 0d 09 74 65 | scrollb|ars}..te|
|00003580| 52 65 63 74 2e 72 69 67 | 68 74 20 3a 3d 20 74 65 |Rect.rig|ht := te|
|00003590| 52 65 63 74 2e 72 69 67 | 68 74 20 2d 20 6b 53 63 |Rect.rig|ht - kSc|
|000035a0| 72 6f 6c 6c 62 61 72 41 | 64 6a 75 73 74 3b 0d 45 |rollbarA|djust;.E|
|000035b0| 4e 44 3b 20 7b 47 65 74 | 54 45 52 65 63 74 7d 0d |ND; {Get|TERect}.|
|000035c0| 0d 0d 7b 24 53 20 4d 61 | 69 6e 7d 0d 46 55 4e 43 |..{$S Ma|in}.FUNC|
|000035d0| 54 49 4f 4e 20 44 6f 43 | 6c 6f 73 65 57 69 6e 64 |TION DoC|loseWind|
|000035e0| 6f 77 28 77 69 6e 64 6f | 77 3a 20 57 69 6e 64 6f |ow(windo|w: Windo|
|000035f0| 77 50 74 72 29 20 3a 20 | 42 4f 4f 4c 45 41 4e 3b |wPtr) : |BOOLEAN;|
|00003600| 0d 0d 7b 43 6c 6f 73 65 | 20 61 20 77 69 6e 64 6f |..{Close| a windo|
|00003610| 77 2e 20 54 68 69 73 20 | 68 61 6e 64 6c 65 73 20 |w. This |handles |
|00003620| 64 65 73 6b 20 61 63 63 | 65 73 73 6f 72 79 20 61 |desk acc|essory a|
|00003630| 6e 64 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 77 |nd appli|cation w|
|00003640| 69 6e 64 6f 77 73 2e 7d | 0d 0d 7b 31 2e 30 31 20 |indows.}|..{1.01 |
|00003650| 2d 20 41 74 20 74 68 69 | 73 20 70 6f 69 6e 74 2c |- At thi|s point,|
|00003660| 20 69 66 20 74 68 65 72 | 65 20 77 61 73 20 61 20 | if ther|e was a |
|00003670| 64 6f 63 75 6d 65 6e 74 | 20 61 73 73 6f 63 69 61 |document| associa|
|00003680| 74 65 64 20 77 69 74 68 | 20 61 0d 20 77 69 6e 64 |ted with| a. wind|
|00003690| 6f 77 2c 20 79 6f 75 20 | 63 6f 75 6c 64 20 64 6f |ow, you |could do|
|000036a0| 20 61 6e 79 20 64 6f 63 | 75 6d 65 6e 74 20 73 61 | any doc|ument sa|
|000036b0| 76 69 6e 67 20 70 72 6f | 63 65 73 73 69 6e 67 20 |ving pro|cessing |
|000036c0| 69 66 20 69 74 20 69 73 | 20 27 64 69 72 74 79 27 |if it is| 'dirty'|
|000036d0| 2e 0d 20 44 6f 43 6c 6f | 73 65 57 69 6e 64 6f 77 |.. DoClo|seWindow|
|000036e0| 20 77 6f 75 6c 64 20 72 | 65 74 75 72 6e 20 54 52 | would r|eturn TR|
|000036f0| 55 45 20 69 66 20 74 68 | 65 20 77 69 6e 64 6f 77 |UE if th|e window|
|00003700| 20 61 63 74 75 61 6c 6c | 79 20 63 6c 6f 73 65 64 | actuall|y closed|
|00003710| 2c 20 69 2e 65 2e 2c 0d | 20 74 68 65 20 75 73 65 |, i.e.,.| the use|
|00003720| 72 20 64 69 64 6e d5 74 | 20 63 61 6e 63 65 6c 20 |r didn.t| cancel |
|00003730| 66 72 6f 6d 20 61 20 73 | 61 76 65 20 64 69 61 6c |from a s|ave dial|
|00003740| 6f 67 2e 20 54 68 69 73 | 20 72 65 73 75 6c 74 20 |og. This| result |
|00003750| 69 73 20 68 61 6e 64 79 | 20 77 68 65 6e 0d 20 74 |is handy| when. t|
|00003760| 68 65 20 75 73 65 72 20 | 71 75 69 74 73 20 61 6e |he user |quits an|
|00003770| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 2c 20 62 75 | applica|tion, bu|
|00003780| 74 20 74 68 65 6e 20 63 | 61 6e 63 65 6c 73 20 74 |t then c|ancels t|
|00003790| 68 65 20 73 61 76 65 20 | 6f 66 20 61 20 64 6f 63 |he save |of a doc|
|000037a0| 75 6d 65 6e 74 0d 20 61 | 73 73 6f 63 69 61 74 65 |ument. a|ssociate|
|000037b0| 64 20 77 69 74 68 20 61 | 20 77 69 6e 64 6f 77 2e |d with a| window.|
|000037c0| 7d 0d 0d 42 45 47 49 4e | 0d 09 44 6f 43 6c 6f 73 |}..BEGIN|..DoClos|
|000037d0| 65 57 69 6e 64 6f 77 20 | 3a 3d 20 54 52 55 45 3b |eWindow |:= TRUE;|
|000037e0| 0d 09 49 46 20 49 73 44 | 41 57 69 6e 64 6f 77 28 |..IF IsD|AWindow(|
|000037f0| 77 69 6e 64 6f 77 29 20 | 54 48 45 4e 0d 09 09 43 |window) |THEN...C|
|00003800| 6c 6f 73 65 44 65 73 6b | 41 63 63 28 57 69 6e 64 |loseDesk|Acc(Wind|
|00003810| 6f 77 50 65 65 6b 28 77 | 69 6e 64 6f 77 29 5e 2e |owPeek(w|indow)^.|
|00003820| 77 69 6e 64 6f 77 4b 69 | 6e 64 29 0d 09 45 4c 53 |windowKi|nd)..ELS|
|00003830| 45 20 49 46 20 49 73 41 | 70 70 57 69 6e 64 6f 77 |E IF IsA|ppWindow|
|00003840| 28 77 69 6e 64 6f 77 29 | 20 54 48 45 4e 20 42 45 |(window)| THEN BE|
|00003850| 47 49 4e 0d 09 09 57 49 | 54 48 20 44 6f 63 75 6d |GIN...WI|TH Docum|
|00003860| 65 6e 74 50 65 65 6b 28 | 77 69 6e 64 6f 77 29 5e |entPeek(|window)^|
|00003870| 20 44 4f 0d 09 09 09 49 | 46 20 64 6f 63 54 45 20 | DO....I|F docTE |
|00003880| 3c 3e 20 4e 49 4c 20 54 | 48 45 4e 0d 09 09 09 09 |<> NIL T|HEN.....|
|00003890| 54 45 44 69 73 70 6f 73 | 65 28 64 6f 63 54 45 29 |TEDispos|e(docTE)|
|000038a0| 3b 09 09 7b 64 69 73 70 | 6f 73 65 20 74 68 65 20 |;..{disp|ose the |
|000038b0| 54 45 48 61 6e 64 6c 65 | 7d 0d 09 09 7b 31 2e 30 |TEHandle|}...{1.0|
|000038c0| 31 20 2d 20 57 65 20 75 | 73 65 64 20 74 6f 20 63 |1 - We u|sed to c|
|000038d0| 61 6c 6c 20 44 69 73 70 | 6f 73 65 57 69 6e 64 6f |all Disp|oseWindo|
|000038e0| 77 2c 20 62 75 74 20 74 | 68 61 74 20 77 61 73 20 |w, but t|hat was |
|000038f0| 74 65 63 68 6e 69 63 61 | 6c 6c 79 0d 09 09 20 69 |technica|lly... i|
|00003900| 6e 63 6f 72 72 65 63 74 | 2c 20 65 76 65 6e 20 74 |ncorrect|, even t|
|00003910| 68 6f 75 67 68 20 77 65 | 20 61 6c 6c 6f 63 61 74 |hough we| allocat|
|00003920| 65 64 20 73 74 6f 72 61 | 67 65 20 66 6f 72 20 74 |ed stora|ge for t|
|00003930| 68 65 20 77 69 6e 64 6f | 77 20 6f 6e 0d 09 09 20 |he windo|w on... |
|00003940| 74 68 65 20 68 65 61 70 | 2e 20 57 65 20 73 68 6f |the heap|. We sho|
|00003950| 75 6c 64 20 69 6e 73 74 | 65 61 64 20 63 61 6c 6c |uld inst|ead call|
|00003960| 20 43 6c 6f 73 65 57 69 | 6e 64 6f 77 20 74 6f 20 | CloseWi|ndow to |
|00003970| 68 61 76 65 20 74 68 65 | 20 73 74 72 75 63 74 75 |have the| structu|
|00003980| 72 65 73 0d 09 09 20 74 | 61 6b 65 6e 20 63 61 72 |res... t|aken car|
|00003990| 65 20 6f 66 20 61 6e 64 | 20 74 68 65 6e 20 64 69 |e of and| then di|
|000039a0| 73 70 6f 73 65 20 6f 66 | 20 74 68 65 20 73 74 6f |spose of| the sto|
|000039b0| 72 61 67 65 20 6f 75 72 | 73 65 6c 76 65 73 2e 7d |rage our|selves.}|
|000039c0| 0d 09 09 43 6c 6f 73 65 | 57 69 6e 64 6f 77 28 77 |...Close|Window(w|
|000039d0| 69 6e 64 6f 77 29 3b 0d | 09 09 44 69 73 70 6f 73 |indow);.|..Dispos|
|000039e0| 50 74 72 28 50 74 72 28 | 77 69 6e 64 6f 77 29 29 |Ptr(Ptr(|window))|
|000039f0| 3b 0d 09 09 67 4e 75 6d | 44 6f 63 75 6d 65 6e 74 |;...gNum|Document|
|00003a00| 73 20 3a 3d 20 67 4e 75 | 6d 44 6f 63 75 6d 65 6e |s := gNu|mDocumen|
|00003a10| 74 73 20 2d 20 31 3b 0d | 09 45 4e 44 3b 0d 45 4e |ts - 1;.|.END;.EN|
|00003a20| 44 3b 20 7b 44 6f 43 6c | 6f 73 65 57 69 6e 64 6f |D; {DoCl|oseWindo|
|00003a30| 77 7d 0d 0d 0d 7b 24 53 | 20 4d 61 69 6e 7d 0d 50 |w}...{$S| Main}.P|
|00003a40| 52 4f 43 45 44 55 52 45 | 20 41 64 6a 75 73 74 56 |ROCEDURE| AdjustV|
|00003a50| 69 65 77 52 65 63 74 28 | 64 6f 63 54 45 3a 20 54 |iewRect(|docTE: T|
|00003a60| 45 48 61 6e 64 6c 65 29 | 3b 0d 0d 7b 55 70 64 61 |EHandle)|;..{Upda|
|00003a70| 74 65 20 74 68 65 20 54 | 45 52 65 63 27 73 20 76 |te the T|ERec's v|
|00003a80| 69 65 77 20 72 65 63 74 | 20 73 6f 20 74 68 61 74 |iew rect| so that|
|00003a90| 20 69 74 20 69 73 20 74 | 68 65 20 67 72 65 61 74 | it is t|he great|
|00003aa0| 65 73 74 20 6d 75 6c 74 | 69 70 6c 65 20 6f 66 0d |est mult|iple of.|
|00003ab0| 74 68 65 20 6c 69 6e 65 | 48 65 69 67 68 74 20 61 |the line|Height a|
|00003ac0| 6e 64 20 73 74 69 6c 6c | 20 66 69 74 73 20 69 6e |nd still| fits in|
|00003ad0| 20 74 68 65 20 6f 6c 64 | 20 76 69 65 77 52 65 63 | the old| viewRec|
|00003ae0| 74 2e 7d 0d 0d 42 45 47 | 49 4e 0d 09 57 49 54 48 |t.}..BEG|IN..WITH|
|00003af0| 20 64 6f 63 54 45 5e 5e | 20 44 4f 20 42 45 47 49 | docTE^^| DO BEGI|
|00003b00| 4e 0d 09 09 76 69 65 77 | 52 65 63 74 2e 62 6f 74 |N...view|Rect.bot|
|00003b10| 74 6f 6d 20 3a 3d 20 28 | 28 28 76 69 65 77 52 65 |tom := (|((viewRe|
|00003b20| 63 74 2e 62 6f 74 74 6f | 6d 20 2d 20 76 69 65 77 |ct.botto|m - view|
|00003b30| 52 65 63 74 2e 74 6f 70 | 29 20 44 49 56 20 6c 69 |Rect.top|) DIV li|
|00003b40| 6e 65 48 65 69 67 68 74 | 29 20 2a 0d 09 09 09 09 |neHeight|) *.....|
|00003b50| 09 09 09 6c 69 6e 65 48 | 65 69 67 68 74 29 20 2b |...lineH|eight) +|
|00003b60| 20 76 69 65 77 52 65 63 | 74 2e 74 6f 70 3b 0d 09 | viewRec|t.top;..|
|00003b70| 45 4e 44 3b 0d 45 4e 44 | 3b 20 7b 41 64 6a 75 73 |END;.END|; {Adjus|
|00003b80| 74 56 69 65 77 52 65 63 | 74 7d 0d 0d 0d 7b 24 53 |tViewRec|t}...{$S|
|00003b90| 20 4d 61 69 6e 7d 0d 50 | 52 4f 43 45 44 55 52 45 | Main}.P|ROCEDURE|
|00003ba0| 20 41 64 6a 75 73 74 54 | 45 28 77 69 6e 64 6f 77 | AdjustT|E(window|
|00003bb0| 3a 20 57 69 6e 64 6f 77 | 50 74 72 29 3b 0d 0d 7b |: Window|Ptr);..{|
|00003bc0| 53 63 72 6f 6c 6c 20 74 | 68 65 20 54 45 52 65 63 |Scroll t|he TERec|
|00003bd0| 20 61 72 6f 75 6e 64 20 | 74 6f 20 6d 61 74 63 68 | around |to match|
|00003be0| 20 75 70 20 74 6f 20 74 | 68 65 20 70 6f 74 65 6e | up to t|he poten|
|00003bf0| 74 69 61 6c 6c 79 20 75 | 70 64 61 74 65 64 20 73 |tially u|pdated s|
|00003c00| 63 72 6f 6c 6c 62 61 72 | 0d 76 61 6c 75 65 73 2e |crollbar|.values.|
|00003c10| 20 54 68 69 73 20 69 73 | 20 72 65 61 6c 6c 79 20 | This is| really |
|00003c20| 75 73 65 66 75 6c 20 77 | 68 65 6e 20 74 68 65 20 |useful w|hen the |
|00003c30| 77 69 6e 64 6f 77 20 72 | 65 73 69 7a 65 73 20 73 |window r|esizes s|
|00003c40| 75 63 68 20 74 68 61 74 | 20 74 68 65 0d 73 63 72 |uch that| the.scr|
|00003c50| 6f 6c 6c 62 61 72 73 20 | 62 65 63 6f 6d 65 20 69 |ollbars |become i|
|00003c60| 6e 61 63 74 69 76 65 20 | 61 6e 64 20 74 68 65 20 |nactive |and the |
|00003c70| 54 45 52 65 63 20 68 61 | 64 20 62 65 65 6e 20 70 |TERec ha|d been p|
|00003c80| 72 65 76 69 6f 75 73 6c | 79 20 73 63 72 6f 6c 6c |reviousl|y scroll|
|00003c90| 65 64 2e 7d 0d 0d 56 41 | 52 0d 09 76 61 6c 75 65 |ed.}..VA|R..value|
|00003ca0| 09 3a 20 49 4e 54 45 47 | 45 52 3b 0d 42 45 47 49 |.: INTEG|ER;.BEGI|
|00003cb0| 4e 0d 09 57 49 54 48 20 | 44 6f 63 75 6d 65 6e 74 |N..WITH |Document|
|00003cc0| 50 65 65 6b 28 77 69 6e | 64 6f 77 29 5e 20 44 4f |Peek(win|dow)^ DO|
|00003cd0| 20 42 45 47 49 4e 0d 09 | 09 54 45 53 63 72 6f 6c | BEGIN..|.TEScrol|
|00003ce0| 6c 28 28 64 6f 63 54 45 | 5e 5e 2e 76 69 65 77 52 |l((docTE|^^.viewR|
|00003cf0| 65 63 74 2e 6c 65 66 74 | 20 2d 20 64 6f 63 54 45 |ect.left| - docTE|
|00003d00| 5e 5e 2e 64 65 73 74 52 | 65 63 74 2e 6c 65 66 74 |^^.destR|ect.left|
|00003d10| 29 20 2d 20 47 65 74 43 | 74 6c 56 61 6c 75 65 28 |) - GetC|tlValue(|
|00003d20| 64 6f 63 48 53 63 72 6f | 6c 6c 29 2c 0d 09 09 09 |docHScro|ll),....|
|00003d30| 09 28 64 6f 63 54 45 5e | 5e 2e 76 69 65 77 52 65 |.(docTE^|^.viewRe|
|00003d40| 63 74 2e 74 6f 70 20 2d | 20 64 6f 63 54 45 5e 5e |ct.top -| docTE^^|
|00003d50| 2e 64 65 73 74 52 65 63 | 74 2e 74 6f 70 29 20 2d |.destRec|t.top) -|
|00003d60| 0d 09 09 09 09 09 28 47 | 65 74 43 74 6c 56 61 6c |......(G|etCtlVal|
|00003d70| 75 65 28 64 6f 63 56 53 | 63 72 6f 6c 6c 29 20 2a |ue(docVS|croll) *|
|00003d80| 20 64 6f 63 54 45 5e 5e | 2e 6c 69 6e 65 48 65 69 | docTE^^|.lineHei|
|00003d90| 67 68 74 29 2c 0d 09 09 | 09 09 64 6f 63 54 45 29 |ght),...|..docTE)|
|00003da0| 3b 0d 09 45 4e 44 3b 0d | 45 4e 44 3b 20 7b 41 64 |;..END;.|END; {Ad|
|00003db0| 6a 75 73 74 54 45 7d 0d | 0d 0d 7b 24 53 20 4d 61 |justTE}.|..{$S Ma|
|00003dc0| 69 6e 7d 0d 50 52 4f 43 | 45 44 55 52 45 20 41 64 |in}.PROC|EDURE Ad|
|00003dd0| 6a 75 73 74 48 56 28 69 | 73 56 65 72 74 3a 20 42 |justHV(i|sVert: B|
|00003de0| 4f 4f 4c 45 41 4e 3b 20 | 63 6f 6e 74 72 6f 6c 3a |OOLEAN; |control:|
|00003df0| 20 43 6f 6e 74 72 6f 6c | 48 61 6e 64 6c 65 3b 20 | Control|Handle; |
|00003e00| 64 6f 63 54 45 3a 20 54 | 45 48 61 6e 64 6c 65 3b |docTE: T|EHandle;|
|00003e10| 20 63 61 6e 52 65 64 72 | 61 77 3a 20 42 4f 4f 4c | canRedr|aw: BOOL|
|00003e20| 45 41 4e 29 3b 0d 0d 7b | 43 61 6c 63 75 6c 61 74 |EAN);..{|Calculat|
|00003e30| 65 20 74 68 65 20 6e 65 | 77 20 63 6f 6e 74 72 6f |e the ne|w contro|
|00003e40| 6c 20 6d 61 78 69 6d 75 | 6d 20 76 61 6c 75 65 20 |l maximu|m value |
|00003e50| 61 6e 64 20 63 75 72 72 | 65 6e 74 20 76 61 6c 75 |and curr|ent valu|
|00003e60| 65 2c 20 77 68 65 74 68 | 65 72 20 69 74 20 69 73 |e, wheth|er it is|
|00003e70| 20 74 68 65 20 68 6f 72 | 69 7a 6f 6e 74 61 6c 20 | the hor|izontal |
|00003e80| 6f 72 0d 76 65 72 74 69 | 63 61 6c 20 73 63 72 6f |or.verti|cal scro|
|00003e90| 6c 6c 62 61 72 2e 20 54 | 68 65 20 76 65 72 74 69 |llbar. T|he verti|
|00003ea0| 63 61 6c 20 6d 61 78 20 | 69 73 20 63 61 6c 63 75 |cal max |is calcu|
|00003eb0| 6c 61 74 65 64 20 62 79 | 20 63 6f 6d 70 61 72 69 |lated by| compari|
|00003ec0| 6e 67 20 74 68 65 20 6e | 75 6d 62 65 72 20 6f 66 |ng the n|umber of|
|00003ed0| 20 6c 69 6e 65 73 20 74 | 6f 20 74 68 65 0d 76 65 | lines t|o the.ve|
|00003ee0| 72 74 69 63 61 6c 20 73 | 69 7a 65 20 6f 66 20 74 |rtical s|ize of t|
|00003ef0| 68 65 20 76 69 65 77 52 | 65 63 74 2e 20 54 68 65 |he viewR|ect. The|
|00003f00| 20 68 6f 72 69 7a 6f 6e | 74 61 6c 20 6d 61 78 20 | horizon|tal max |
|00003f10| 69 73 20 63 61 6c 63 75 | 6c 61 74 65 64 20 62 79 |is calcu|lated by|
|00003f20| 20 63 6f 6d 70 61 72 69 | 6e 67 20 74 68 65 20 6d | compari|ng the m|
|00003f30| 61 78 69 6d 75 6d 20 64 | 6f 63 75 6d 65 6e 74 0d |aximum d|ocument.|
|00003f40| 77 69 64 74 68 20 74 6f | 20 74 68 65 20 77 69 64 |width to| the wid|
|00003f50| 74 68 20 6f 66 20 74 68 | 65 20 76 69 65 77 52 65 |th of th|e viewRe|
|00003f60| 63 74 2e 20 54 68 65 20 | 63 75 72 72 65 6e 74 20 |ct. The |current |
|00003f70| 76 61 6c 75 65 73 20 61 | 72 65 20 73 65 74 20 62 |values a|re set b|
|00003f80| 79 20 63 6f 6d 70 61 72 | 69 6e 67 20 74 68 65 20 |y compar|ing the |
|00003f90| 6f 66 66 73 65 74 20 62 | 65 74 77 65 65 6e 0d 74 |offset b|etween.t|
|00003fa0| 68 65 20 76 69 65 77 20 | 61 6e 64 20 64 65 73 74 |he view |and dest|
|00003fb0| 69 6e 61 74 69 6f 6e 20 | 72 65 63 74 73 2e 20 49 |ination |rects. I|
|00003fc0| 66 20 6e 65 63 65 73 73 | 61 72 79 20 61 6e 64 20 |f necess|ary and |
|00003fd0| 77 65 20 63 61 6e 52 65 | 64 72 61 77 2c 20 68 61 |we canRe|draw, ha|
|00003fe0| 76 65 20 74 68 65 20 63 | 6f 6e 74 72 6f 6c 20 62 |ve the c|ontrol b|
|00003ff0| 65 20 72 65 2d 64 72 61 | 77 6e 20 62 79 0d 63 61 |e re-dra|wn by.ca|
|00004000| 6c 6c 69 6e 67 20 53 68 | 6f 77 43 6f 6e 74 72 6f |lling Sh|owContro|
|00004010| 6c 2e 7d 0d 0d 56 41 52 | 0d 09 76 61 6c 75 65 2c |l.}..VAR|..value,|
|00004020| 20 6c 69 6e 65 73 2c 20 | 6d 61 78 09 3a 20 49 4e | lines, |max.: IN|
|00004030| 54 45 47 45 52 3b 0d 09 | 6f 6c 64 56 61 6c 75 65 |TEGER;..|oldValue|
|00004040| 2c 20 6f 6c 64 4d 61 78 | 09 3a 20 49 4e 54 45 47 |, oldMax|.: INTEG|
|00004050| 45 52 3b 0d 42 45 47 49 | 4e 0d 09 6f 6c 64 56 61 |ER;.BEGI|N..oldVa|
|00004060| 6c 75 65 20 3a 3d 20 47 | 65 74 43 74 6c 56 61 6c |lue := G|etCtlVal|
|00004070| 75 65 28 63 6f 6e 74 72 | 6f 6c 29 3b 0d 09 6f 6c |ue(contr|ol);..ol|
|00004080| 64 4d 61 78 20 3a 3d 20 | 47 65 74 43 74 6c 4d 61 |dMax := |GetCtlMa|
|00004090| 78 28 63 6f 6e 74 72 6f | 6c 29 3b 0d 09 49 46 20 |x(contro|l);..IF |
|000040a0| 69 73 56 65 72 74 20 54 | 48 45 4e 20 42 45 47 49 |isVert T|HEN BEGI|
|000040b0| 4e 0d 09 09 6c 69 6e 65 | 73 20 3a 3d 20 64 6f 63 |N...line|s := doc|
|000040c0| 54 45 5e 5e 2e 6e 4c 69 | 6e 65 73 3b 0d 09 09 7b |TE^^.nLi|nes;...{|
|000040d0| 73 69 6e 63 65 20 6e 4c | 69 6e 65 73 20 69 73 6e |since nL|ines isn|
|000040e0| d5 74 20 72 69 67 68 74 | 20 69 66 20 74 68 65 20 |.t right| if the |
|000040f0| 6c 61 73 74 20 63 68 61 | 72 61 63 74 65 72 20 69 |last cha|racter i|
|00004100| 73 20 61 20 72 65 74 75 | 72 6e 2c 20 63 68 65 63 |s a retu|rn, chec|
|00004110| 6b 20 66 6f 72 20 74 68 | 61 74 20 63 61 73 65 7d |k for th|at case}|
|00004120| 0d 09 09 49 46 20 50 74 | 72 28 4f 52 44 28 64 6f |...IF Pt|r(ORD(do|
|00004130| 63 54 45 5e 5e 2e 68 54 | 65 78 74 5e 29 20 2b 20 |cTE^^.hT|ext^) + |
|00004140| 64 6f 63 54 45 5e 5e 2e | 74 65 4c 65 6e 67 74 68 |docTE^^.|teLength|
|00004150| 20 2d 20 31 29 5e 20 3d | 20 6b 43 52 43 68 61 72 | - 1)^ =| kCRChar|
|00004160| 20 54 48 45 4e 0d 09 09 | 09 6c 69 6e 65 73 20 3a | THEN...|.lines :|
|00004170| 3d 20 6c 69 6e 65 73 20 | 2b 20 31 3b 0d 09 09 6d |= lines |+ 1;...m|
|00004180| 61 78 20 3a 3d 20 6c 69 | 6e 65 73 20 2d 20 28 28 |ax := li|nes - ((|
|00004190| 64 6f 63 54 45 5e 5e 2e | 76 69 65 77 52 65 63 74 |docTE^^.|viewRect|
|000041a0| 2e 62 6f 74 74 6f 6d 20 | 2d 20 64 6f 63 54 45 5e |.bottom |- docTE^|
|000041b0| 5e 2e 76 69 65 77 52 65 | 63 74 2e 74 6f 70 29 20 |^.viewRe|ct.top) |
|000041c0| 44 49 56 20 64 6f 63 54 | 45 5e 5e 2e 6c 69 6e 65 |DIV docT|E^^.line|
|000041d0| 48 65 69 67 68 74 29 3b | 0d 09 45 4e 44 20 45 4c |Height);|..END EL|
|000041e0| 53 45 0d 09 09 6d 61 78 | 20 3a 3d 20 6b 4d 61 78 |SE...max| := kMax|
|000041f0| 44 6f 63 57 69 64 74 68 | 20 2d 20 28 64 6f 63 54 |DocWidth| - (docT|
|00004200| 45 5e 5e 2e 76 69 65 77 | 52 65 63 74 2e 72 69 67 |E^^.view|Rect.rig|
|00004210| 68 74 20 2d 20 64 6f 63 | 54 45 5e 5e 2e 76 69 65 |ht - doc|TE^^.vie|
|00004220| 77 52 65 63 74 2e 6c 65 | 66 74 29 3b 0d 09 49 46 |wRect.le|ft);..IF|
|00004230| 20 6d 61 78 20 3c 20 30 | 20 54 48 45 4e 20 6d 61 | max < 0| THEN ma|
|00004240| 78 20 3a 3d 20 30 3b 09 | 09 09 7b 63 68 65 63 6b |x := 0;.|..{check|
|00004250| 20 66 6f 72 20 6e 65 67 | 61 74 69 76 65 20 76 61 | for neg|ative va|
|00004260| 6c 75 65 73 7d 0d 09 53 | 65 74 43 74 6c 4d 61 78 |lues}..S|etCtlMax|
|00004270| 28 63 6f 6e 74 72 6f 6c | 2c 20 6d 61 78 29 3b 0d |(control|, max);.|
|00004280| 09 49 46 20 69 73 56 65 | 72 74 20 54 48 45 4e 0d |.IF isVe|rt THEN.|
|00004290| 09 09 76 61 6c 75 65 20 | 3a 3d 20 28 64 6f 63 54 |..value |:= (docT|
|000042a0| 45 5e 5e 2e 76 69 65 77 | 52 65 63 74 2e 74 6f 70 |E^^.view|Rect.top|
|000042b0| 20 2d 20 64 6f 63 54 45 | 5e 5e 2e 64 65 73 74 52 | - docTE|^^.destR|
|000042c0| 65 63 74 2e 74 6f 70 29 | 20 44 49 56 20 64 6f 63 |ect.top)| DIV doc|
|000042d0| 54 45 5e 5e 2e 6c 69 6e | 65 48 65 69 67 68 74 0d |TE^^.lin|eHeight.|
|000042e0| 09 45 4c 53 45 0d 09 09 | 76 61 6c 75 65 20 3a 3d |.ELSE...|value :=|
|000042f0| 20 64 6f 63 54 45 5e 5e | 2e 76 69 65 77 52 65 63 | docTE^^|.viewRec|
|00004300| 74 2e 6c 65 66 74 20 2d | 20 64 6f 63 54 45 5e 5e |t.left -| docTE^^|
|00004310| 2e 64 65 73 74 52 65 63 | 74 2e 6c 65 66 74 3b 0d |.destRec|t.left;.|
|00004320| 09 49 46 20 76 61 6c 75 | 65 20 3c 20 30 20 54 48 |.IF valu|e < 0 TH|
|00004330| 45 4e 0d 09 09 76 61 6c | 75 65 20 3a 3d 20 30 0d |EN...val|ue := 0.|
|00004340| 09 45 4c 53 45 20 49 46 | 20 76 61 6c 75 65 20 3e |.ELSE IF| value >|
|00004350| 20 6d 61 78 20 54 48 45 | 4e 0d 09 09 76 61 6c 75 | max THE|N...valu|
|00004360| 65 20 3a 3d 20 6d 61 78 | 3b 09 09 09 09 09 7b 70 |e := max|;.....{p|
|00004370| 69 6e 20 74 68 65 20 76 | 61 6c 75 65 20 74 6f 20 |in the v|alue to |
|00004380| 77 69 74 68 69 6e 20 72 | 61 6e 67 65 7d 0d 09 53 |within r|ange}..S|
|00004390| 65 74 43 74 6c 56 61 6c | 75 65 28 63 6f 6e 74 72 |etCtlVal|ue(contr|
|000043a0| 6f 6c 2c 20 76 61 6c 75 | 65 29 3b 0d 09 49 46 20 |ol, valu|e);..IF |
|000043b0| 63 61 6e 52 65 64 72 61 | 77 20 26 20 28 20 28 6d |canRedra|w & ( (m|
|000043c0| 61 78 20 3c 3e 20 6f 6c | 64 4d 61 78 29 20 7c 20 |ax <> ol|dMax) | |
|000043d0| 28 76 61 6c 75 65 20 3c | 3e 20 6f 6c 64 56 61 6c |(value <|> oldVal|
|000043e0| 75 65 29 20 29 20 54 48 | 45 4e 0d 09 09 53 68 6f |ue) ) TH|EN...Sho|
|000043f0| 77 43 6f 6e 74 72 6f 6c | 28 63 6f 6e 74 72 6f 6c |wControl|(control|
|00004400| 29 3b 09 09 09 7b 63 68 | 65 63 6b 20 74 6f 20 73 |);...{ch|eck to s|
|00004410| 65 65 20 69 66 20 74 68 | 65 20 63 6f 6e 74 72 6f |ee if th|e contro|
|00004420| 6c 20 63 61 6e 20 62 65 | 20 72 65 2d 64 72 61 77 |l can be| re-draw|
|00004430| 6e 7d 0d 45 4e 44 3b 20 | 7b 41 64 6a 75 73 74 48 |n}.END; |{AdjustH|
|00004440| 56 7d 0d 0d 0d 7b 24 53 | 20 4d 61 69 6e 7d 0d 50 |V}...{$S| Main}.P|
|00004450| 52 4f 43 45 44 55 52 45 | 20 41 64 6a 75 73 74 53 |ROCEDURE| AdjustS|
|00004460| 63 72 6f 6c 6c 56 61 6c | 75 65 73 28 77 69 6e 64 |crollVal|ues(wind|
|00004470| 6f 77 3a 20 57 69 6e 64 | 6f 77 50 74 72 3b 20 63 |ow: Wind|owPtr; c|
|00004480| 61 6e 52 65 64 72 61 77 | 3a 20 42 4f 4f 4c 45 41 |anRedraw|: BOOLEA|
|00004490| 4e 29 3b 0d 0d 7b 53 69 | 6d 70 6c 79 20 63 61 6c |N);..{Si|mply cal|
|000044a0| 6c 20 74 68 65 20 63 6f | 6d 6d 6f 6e 20 61 64 6a |l the co|mmon adj|
|000044b0| 75 73 74 20 72 6f 75 74 | 69 6e 65 20 66 6f 72 20 |ust rout|ine for |
|000044c0| 74 68 65 20 76 65 72 74 | 69 63 61 6c 20 61 6e 64 |the vert|ical and|
|000044d0| 20 68 6f 72 69 7a 6f 6e | 74 61 6c 20 73 63 72 6f | horizon|tal scro|
|000044e0| 6c 6c 62 61 72 73 2e 7d | 0d 0d 42 45 47 49 4e 0d |llbars.}|..BEGIN.|
|000044f0| 09 57 49 54 48 20 44 6f | 63 75 6d 65 6e 74 50 65 |.WITH Do|cumentPe|
|00004500| 65 6b 28 77 69 6e 64 6f | 77 29 5e 20 44 4f 20 42 |ek(windo|w)^ DO B|
|00004510| 45 47 49 4e 0d 09 09 41 | 64 6a 75 73 74 48 56 28 |EGIN...A|djustHV(|
|00004520| 54 52 55 45 2c 20 64 6f | 63 56 53 63 72 6f 6c 6c |TRUE, do|cVScroll|
|00004530| 2c 20 64 6f 63 54 45 2c | 20 63 61 6e 52 65 64 72 |, docTE,| canRedr|
|00004540| 61 77 29 3b 0d 09 09 41 | 64 6a 75 73 74 48 56 28 |aw);...A|djustHV(|
|00004550| 46 41 4c 53 45 2c 20 64 | 6f 63 48 53 63 72 6f 6c |FALSE, d|ocHScrol|
|00004560| 6c 2c 20 64 6f 63 54 45 | 2c 20 63 61 6e 52 65 64 |l, docTE|, canRed|
|00004570| 72 61 77 29 3b 0d 09 45 | 4e 44 3b 0d 45 4e 44 3b |raw);..E|ND;.END;|
|00004580| 20 7b 41 64 6a 75 73 74 | 53 63 72 6f 6c 6c 56 61 | {Adjust|ScrollVa|
|00004590| 6c 75 65 73 7d 0d 0d 0d | 7b 24 53 20 4d 61 69 6e |lues}...|{$S Main|
|000045a0| 7d 0d 50 52 4f 43 45 44 | 55 52 45 20 41 64 6a 75 |}.PROCED|URE Adju|
|000045b0| 73 74 53 63 72 6f 6c 6c | 53 69 7a 65 73 28 77 69 |stScroll|Sizes(wi|
|000045c0| 6e 64 6f 77 3a 20 57 69 | 6e 64 6f 77 50 74 72 29 |ndow: Wi|ndowPtr)|
|000045d0| 3b 0d 0d 7b 52 65 2d 63 | 61 6c 63 75 6c 61 74 65 |;..{Re-c|alculate|
|000045e0| 20 74 68 65 20 70 6f 73 | 69 74 69 6f 6e 20 61 6e | the pos|ition an|
|000045f0| 64 20 73 69 7a 65 20 6f | 66 20 74 68 65 20 76 69 |d size o|f the vi|
|00004600| 65 77 52 65 63 74 20 61 | 6e 64 20 74 68 65 20 73 |ewRect a|nd the s|
|00004610| 63 72 6f 6c 6c 62 61 72 | 73 2e 0d 20 6b 53 63 72 |crollbar|s.. kScr|
|00004620| 6f 6c 6c 54 77 65 65 6b | 20 63 6f 6d 70 65 6e 73 |ollTweek| compens|
|00004630| 61 74 65 73 20 66 6f 72 | 20 6f 66 66 2d 62 79 2d |ates for| off-by-|
|00004640| 6f 6e 65 20 72 65 71 75 | 69 72 65 6d 65 6e 74 73 |one requ|irements|
|00004650| 20 6f 66 20 74 68 65 20 | 73 63 72 6f 6c 6c 62 61 | of the |scrollba|
|00004660| 72 73 0d 20 74 6f 20 68 | 61 76 65 20 62 6f 72 64 |rs. to h|ave bord|
|00004670| 65 72 73 20 63 6f 69 6e | 63 69 64 65 20 77 69 74 |ers coin|cide wit|
|00004680| 68 20 74 68 65 20 67 72 | 6f 77 62 6f 78 2e 7d 0d |h the gr|owbox.}.|
|00004690| 0d 56 41 52 0d 09 74 65 | 52 65 63 74 09 3a 20 52 |.VAR..te|Rect.: R|
|000046a0| 65 63 74 3b 0d 42 45 47 | 49 4e 0d 09 47 65 74 54 |ect;.BEG|IN..GetT|
|000046b0| 45 52 65 63 74 28 77 69 | 6e 64 6f 77 2c 20 74 65 |ERect(wi|ndow, te|
|000046c0| 52 65 63 74 29 3b 09 09 | 09 09 09 09 09 09 09 09 |Rect);..|........|
|000046d0| 7b 73 74 61 72 74 20 77 | 69 74 68 20 74 65 52 65 |{start w|ith teRe|
|000046e0| 63 74 7d 0d 09 57 49 54 | 48 20 44 6f 63 75 6d 65 |ct}..WIT|H Docume|
|000046f0| 6e 74 50 65 65 6b 28 77 | 69 6e 64 6f 77 29 5e 2c |ntPeek(w|indow)^,|
|00004700| 20 77 69 6e 64 6f 77 5e | 2e 70 6f 72 74 52 65 63 | window^|.portRec|
|00004710| 74 20 44 4f 20 42 45 47 | 49 4e 0d 09 09 64 6f 63 |t DO BEG|IN...doc|
|00004720| 54 45 5e 5e 2e 76 69 65 | 77 52 65 63 74 20 3a 3d |TE^^.vie|wRect :=|
|00004730| 20 74 65 52 65 63 74 3b | 0d 09 09 41 64 6a 75 73 | teRect;|...Adjus|
|00004740| 74 56 69 65 77 52 65 63 | 74 28 64 6f 63 54 45 29 |tViewRec|t(docTE)|
|00004750| 3b 09 09 09 09 09 09 09 | 09 09 09 7b 73 6e 61 70 |;.......|...{snap|
|00004760| 20 74 6f 20 6e 65 61 72 | 65 73 74 20 6c 69 6e 65 | to near|est line|
|00004770| 7d 0d 09 09 4d 6f 76 65 | 43 6f 6e 74 72 6f 6c 28 |}...Move|Control(|
|00004780| 64 6f 63 56 53 63 72 6f | 6c 6c 2c 20 72 69 67 68 |docVScro|ll, righ|
|00004790| 74 20 2d 20 6b 53 63 72 | 6f 6c 6c 62 61 72 41 64 |t - kScr|ollbarAd|
|000047a0| 6a 75 73 74 2c 20 2d 31 | 29 3b 0d 09 09 53 69 7a |just, -1|);...Siz|
|000047b0| 65 43 6f 6e 74 72 6f 6c | 28 64 6f 63 56 53 63 72 |eControl|(docVScr|
|000047c0| 6f 6c 6c 2c 20 6b 53 63 | 72 6f 6c 6c 62 61 72 57 |oll, kSc|rollbarW|
|000047d0| 69 64 74 68 2c 20 28 62 | 6f 74 74 6f 6d 20 2d 20 |idth, (b|ottom - |
|000047e0| 74 6f 70 29 20 2d 0d 09 | 09 09 09 09 09 28 6b 53 |top) -..|.....(kS|
|000047f0| 63 72 6f 6c 6c 62 61 72 | 41 64 6a 75 73 74 20 2d |crollbar|Adjust -|
|00004800| 20 6b 53 63 72 6f 6c 6c | 54 77 65 65 6b 29 29 3b | kScroll|Tweek));|
|00004810| 0d 09 09 4d 6f 76 65 43 | 6f 6e 74 72 6f 6c 28 64 |...MoveC|ontrol(d|
|00004820| 6f 63 48 53 63 72 6f 6c | 6c 2c 20 2d 31 2c 20 62 |ocHScrol|l, -1, b|
|00004830| 6f 74 74 6f 6d 20 2d 20 | 6b 53 63 72 6f 6c 6c 62 |ottom - |kScrollb|
|00004840| 61 72 41 64 6a 75 73 74 | 29 3b 0d 09 09 53 69 7a |arAdjust|);...Siz|
|00004850| 65 43 6f 6e 74 72 6f 6c | 28 64 6f 63 48 53 63 72 |eControl|(docHScr|
|00004860| 6f 6c 6c 2c 20 28 72 69 | 67 68 74 20 2d 20 6c 65 |oll, (ri|ght - le|
|00004870| 66 74 29 20 2d 20 28 6b | 53 63 72 6f 6c 6c 62 61 |ft) - (k|Scrollba|
|00004880| 72 41 64 6a 75 73 74 20 | 2d 0d 09 09 09 09 09 09 |rAdjust |-.......|
|00004890| 6b 53 63 72 6f 6c 6c 54 | 77 65 65 6b 29 2c 20 6b |kScrollT|week), k|
|000048a0| 53 63 72 6f 6c 6c 62 61 | 72 57 69 64 74 68 29 3b |Scrollba|rWidth);|
|000048b0| 0d 09 45 4e 44 3b 0d 45 | 4e 44 3b 20 7b 41 64 6a |..END;.E|ND; {Adj|
|000048c0| 75 73 74 53 63 72 6f 6c | 6c 53 69 7a 65 73 7d 0d |ustScrol|lSizes}.|
|000048d0| 0d 0d 7b 24 53 20 4d 61 | 69 6e 7d 0d 50 52 4f 43 |..{$S Ma|in}.PROC|
|000048e0| 45 44 55 52 45 20 41 64 | 6a 75 73 74 53 63 72 6f |EDURE Ad|justScro|
|000048f0| 6c 6c 62 61 72 73 28 77 | 69 6e 64 6f 77 3a 20 57 |llbars(w|indow: W|
|00004900| 69 6e 64 6f 77 50 74 72 | 3b 20 6e 65 65 64 73 52 |indowPtr|; needsR|
|00004910| 65 73 69 7a 65 3a 20 42 | 4f 4f 4c 45 41 4e 29 3b |esize: B|OOLEAN);|
|00004920| 0d 0d 7b 54 75 72 6e 20 | 6f 66 66 20 74 68 65 20 |..{Turn |off the |
|00004930| 63 6f 6e 74 72 6f 6c 73 | 20 62 79 20 6a 61 6d 6d |controls| by jamm|
|00004940| 69 6e 67 20 61 20 7a 65 | 72 6f 20 69 6e 74 6f 20 |ing a ze|ro into |
|00004950| 74 68 65 69 72 20 63 6f | 6e 74 72 6c 56 69 73 20 |their co|ntrlVis |
|00004960| 66 69 65 6c 64 73 20 28 | 48 69 64 65 43 6f 6e 74 |fields (|HideCont|
|00004970| 72 6f 6c 20 65 72 61 73 | 65 73 20 74 68 65 6d 0d |rol eras|es them.|
|00004980| 61 6e 64 20 77 65 20 64 | 6f 6e 27 74 20 77 61 6e |and we d|on't wan|
|00004990| 74 20 74 68 61 74 29 2e | 20 49 66 20 74 68 65 20 |t that).| If the |
|000049a0| 63 6f 6e 74 72 6f 6c 73 | 20 61 72 65 20 74 6f 20 |controls| are to |
|000049b0| 62 65 20 72 65 73 69 7a | 65 64 20 61 73 20 77 65 |be resiz|ed as we|
|000049c0| 6c 6c 2c 20 63 61 6c 6c | 20 74 68 65 20 70 72 6f |ll, call| the pro|
|000049d0| 63 65 64 75 72 65 20 74 | 6f 20 64 6f 20 74 68 61 |cedure t|o do tha|
|000049e0| 74 2c 0d 74 68 65 6e 20 | 63 61 6c 6c 20 74 68 65 |t,.then |call the|
|000049f0| 20 70 72 6f 63 65 64 75 | 72 65 20 74 6f 20 61 64 | procedu|re to ad|
|00004a00| 6a 75 73 74 20 74 68 65 | 20 6d 61 78 69 6d 75 6d |just the| maximum|
|00004a10| 20 61 6e 64 20 63 75 72 | 72 65 6e 74 20 76 61 6c | and cur|rent val|
|00004a20| 75 65 73 2e 20 46 69 6e | 61 6c 6c 79 20 72 65 2d |ues. Fin|ally re-|
|00004a30| 65 6e 61 62 6c 65 20 74 | 68 65 20 63 6f 6e 74 72 |enable t|he contr|
|00004a40| 6f 6c 73 0d 62 79 20 6a | 61 6d 6d 69 6e 67 20 61 |ols.by j|amming a|
|00004a50| 20 24 46 46 20 69 6e 20 | 74 68 65 69 72 20 63 6f | $FF in |their co|
|00004a60| 6e 74 72 6c 56 69 73 20 | 66 69 65 6c 64 73 2e 7d |ntrlVis |fields.}|
|00004a70| 0d 0d 56 41 52 0d 09 6f | 6c 64 4d 61 78 2c 20 6f |..VAR..o|ldMax, o|
|00004a80| 6c 64 56 61 6c 09 3a 20 | 49 4e 54 45 47 45 52 3b |ldVal.: |INTEGER;|
|00004a90| 0d 42 45 47 49 4e 0d 09 | 57 49 54 48 20 44 6f 63 |.BEGIN..|WITH Doc|
|00004aa0| 75 6d 65 6e 74 50 65 65 | 6b 28 77 69 6e 64 6f 77 |umentPee|k(window|
|00004ab0| 29 5e 20 44 4f 20 42 45 | 47 49 4e 0d 09 09 7b 46 |)^ DO BE|GIN...{F|
|00004ac0| 69 72 73 74 2c 20 74 75 | 72 6e 20 76 69 73 69 62 |irst, tu|rn visib|
|00004ad0| 69 6c 69 74 79 20 6f 66 | 20 73 63 72 6f 6c 6c 62 |ility of| scrollb|
|00004ae0| 61 72 73 20 6f 66 66 20 | 73 6f 20 77 65 20 77 6f |ars off |so we wo|
|00004af0| 6e d5 74 20 67 65 74 20 | 75 6e 77 61 6e 74 65 64 |n.t get |unwanted|
|00004b00| 20 72 65 64 72 61 77 69 | 6e 67 7d 0d 09 09 64 6f | redrawi|ng}...do|
|00004b10| 63 56 53 63 72 6f 6c 6c | 5e 5e 2e 63 6f 6e 74 72 |cVScroll|^^.contr|
|00004b20| 6c 56 69 73 20 3a 3d 20 | 6b 43 6f 6e 74 72 6f 6c |lVis := |kControl|
|00004b30| 49 6e 76 69 73 69 62 6c | 65 3b 09 7b 74 75 72 6e |Invisibl|e;.{turn|
|00004b40| 20 74 68 65 6d 20 6f 66 | 66 7d 0d 09 09 64 6f 63 | them of|f}...doc|
|00004b50| 48 53 63 72 6f 6c 6c 5e | 5e 2e 63 6f 6e 74 72 6c |HScroll^|^.contrl|
|00004b60| 56 69 73 20 3a 3d 20 6b | 43 6f 6e 74 72 6f 6c 49 |Vis := k|ControlI|
|00004b70| 6e 76 69 73 69 62 6c 65 | 3b 0d 09 09 49 46 20 6e |nvisible|;...IF n|
|00004b80| 65 65 64 73 52 65 73 69 | 7a 65 20 54 48 45 4e 09 |eedsResi|ze THEN.|
|00004b90| 09 09 09 09 09 09 09 7b | 6d 6f 76 65 20 61 6e 64 |.......{|move and|
|00004ba0| 20 73 69 7a 65 20 69 66 | 20 6e 65 65 64 65 64 7d | size if| needed}|
|00004bb0| 0d 09 09 09 41 64 6a 75 | 73 74 53 63 72 6f 6c 6c |....Adju|stScroll|
|00004bc0| 53 69 7a 65 73 28 77 69 | 6e 64 6f 77 29 3b 0d 09 |Sizes(wi|ndow);..|
|00004bd0| 09 41 64 6a 75 73 74 53 | 63 72 6f 6c 6c 56 61 6c |.AdjustS|crollVal|
|00004be0| 75 65 73 28 77 69 6e 64 | 6f 77 2c 20 4e 4f 54 20 |ues(wind|ow, NOT |
|00004bf0| 6e 65 65 64 73 52 65 73 | 69 7a 65 29 3b 09 7b 66 |needsRes|ize);.{f|
|00004c00| 6f 6f 6c 20 77 69 74 68 | 20 6d 61 78 20 61 6e 64 |ool with| max and|
|00004c10| 20 63 75 72 72 65 6e 74 | 20 76 61 6c 75 65 7d 0d | current| value}.|
|00004c20| 09 09 7b 4e 6f 77 2c 20 | 72 65 73 74 6f 72 65 20 |..{Now, |restore |
|00004c30| 76 69 73 69 62 69 6c 69 | 74 79 20 69 6e 20 63 61 |visibili|ty in ca|
|00004c40| 73 65 20 77 65 20 6e 65 | 76 65 72 20 68 61 64 20 |se we ne|ver had |
|00004c50| 74 6f 20 53 68 6f 77 43 | 6f 6e 74 72 6f 6c 20 64 |to ShowC|ontrol d|
|00004c60| 75 72 69 6e 67 20 61 64 | 6a 75 73 74 6d 65 6e 74 |uring ad|justment|
|00004c70| 7d 0d 09 09 64 6f 63 56 | 53 63 72 6f 6c 6c 5e 5e |}...docV|Scroll^^|
|00004c80| 2e 63 6f 6e 74 72 6c 56 | 69 73 20 3a 3d 20 6b 43 |.contrlV|is := kC|
|00004c90| 6f 6e 74 72 6f 6c 56 69 | 73 69 62 6c 65 3b 09 09 |ontrolVi|sible;..|
|00004ca0| 7b 74 75 72 6e 20 74 68 | 65 6d 20 6f 6e 7d 0d 09 |{turn th|em on}..|
|00004cb0| 09 64 6f 63 48 53 63 72 | 6f 6c 6c 5e 5e 2e 63 6f |.docHScr|oll^^.co|
|00004cc0| 6e 74 72 6c 56 69 73 20 | 3a 3d 20 6b 43 6f 6e 74 |ntrlVis |:= kCont|
|00004cd0| 72 6f 6c 56 69 73 69 62 | 6c 65 3b 0d 09 45 4e 44 |rolVisib|le;..END|
|00004ce0| 3b 0d 45 4e 44 3b 20 7b | 41 64 6a 75 73 74 53 63 |;.END; {|AdjustSc|
|00004cf0| 72 6f 6c 6c 62 61 72 73 | 7d 0d 0d 0d 7b 24 53 20 |rollbars|}...{$S |
|00004d00| 4d 61 69 6e 7d 0d 7b 24 | 50 55 53 48 7d 20 7b 24 |Main}.{$|PUSH} {$|
|00004d10| 5a 2b 7d 0d 50 52 4f 43 | 45 44 55 52 45 20 50 61 |Z+}.PROC|EDURE Pa|
|00004d20| 73 63 61 6c 43 6c 69 6b | 4c 6f 6f 70 3b 0d 0d 7b |scalClik|Loop;..{|
|00004d30| 47 65 74 73 20 63 61 6c | 6c 65 64 20 66 72 6f 6d |Gets cal|led from|
|00004d40| 20 6f 75 72 20 61 73 73 | 65 6d 62 6c 79 20 6c 61 | our ass|embly la|
|00004d50| 6e 67 75 61 67 65 20 72 | 6f 75 74 69 6e 65 2c 20 |nguage r|outine, |
|00004d60| 41 73 6d 43 6c 69 6b 4c | 6f 6f 70 2c 20 77 68 69 |AsmClikL|oop, whi|
|00004d70| 63 68 20 69 73 20 69 6e | 0d 20 74 75 72 6e 20 63 |ch is in|. turn c|
|00004d80| 61 6c 6c 65 64 20 62 79 | 20 74 68 65 20 54 45 43 |alled by| the TEC|
|00004d90| 6c 69 63 6b 20 74 6f 6f | 6c 62 6f 78 20 72 6f 75 |lick too|lbox rou|
|00004da0| 74 69 6e 65 2e 20 53 61 | 76 65 73 20 74 68 65 20 |tine. Sa|ves the |
|00004db0| 77 69 6e 64 6f 77 73 20 | 63 6c 69 70 20 72 65 67 |windows |clip reg|
|00004dc0| 69 6f 6e 2c 0d 20 73 65 | 74 73 20 69 74 20 74 6f |ion,. se|ts it to|
|00004dd0| 20 74 68 65 20 70 6f 72 | 74 52 65 63 74 2c 20 61 | the por|tRect, a|
|00004de0| 64 6a 75 73 74 73 20 74 | 68 65 20 73 63 72 6f 6c |djusts t|he scrol|
|00004df0| 6c 62 61 72 20 76 61 6c | 75 65 73 20 74 6f 20 6d |lbar val|ues to m|
|00004e00| 61 74 63 68 20 74 68 65 | 20 54 45 20 73 63 72 6f |atch the| TE scro|
|00004e10| 6c 6c 0d 20 61 6d 6f 75 | 6e 74 2c 20 74 68 65 6e |ll. amou|nt, then|
|00004e20| 20 72 65 73 74 6f 72 65 | 73 20 74 68 65 20 63 6c | restore|s the cl|
|00004e30| 69 70 20 72 65 67 69 6f | 6e 2e 7d 0d 0d 56 41 52 |ip regio|n.}..VAR|
|00004e40| 0d 09 77 69 6e 64 6f 77 | 09 3a 20 57 69 6e 64 6f |..window|.: Windo|
|00004e50| 77 50 74 72 3b 0d 09 72 | 65 67 69 6f 6e 09 3a 20 |wPtr;..r|egion.: |
|00004e60| 52 67 6e 48 61 6e 64 6c | 65 3b 0d 42 45 47 49 4e |RgnHandl|e;.BEGIN|
|00004e70| 0d 09 77 69 6e 64 6f 77 | 20 3a 3d 20 46 72 6f 6e |..window| := Fron|
|00004e80| 74 57 69 6e 64 6f 77 3b | 0d 09 72 65 67 69 6f 6e |tWindow;|..region|
|00004e90| 20 3a 3d 20 4e 65 77 52 | 67 6e 3b 0d 09 47 65 74 | := NewR|gn;..Get|
|00004ea0| 43 6c 69 70 28 72 65 67 | 69 6f 6e 29 3b 09 09 09 |Clip(reg|ion);...|
|00004eb0| 09 09 7b 73 61 76 65 20 | 74 68 65 20 6f 6c 64 20 |..{save |the old |
|00004ec0| 63 6c 69 70 7d 0d 09 43 | 6c 69 70 52 65 63 74 28 |clip}..C|lipRect(|
|00004ed0| 77 69 6e 64 6f 77 5e 2e | 70 6f 72 74 52 65 63 74 |window^.|portRect|
|00004ee0| 29 3b 09 09 09 7b 73 65 | 74 20 74 68 65 20 6e 65 |);...{se|t the ne|
|00004ef0| 77 20 63 6c 69 70 7d 0d | 09 41 64 6a 75 73 74 53 |w clip}.|.AdjustS|
|00004f00| 63 72 6f 6c 6c 56 61 6c | 75 65 73 28 77 69 6e 64 |crollVal|ues(wind|
|00004f10| 6f 77 2c 20 54 52 55 45 | 29 3b 09 7b 70 61 73 73 |ow, TRUE|);.{pass|
|00004f20| 20 54 52 55 45 20 66 6f | 72 20 63 61 6e 52 65 64 | TRUE fo|r canRed|
|00004f30| 72 61 77 7d 0d 09 53 65 | 74 43 6c 69 70 28 72 65 |raw}..Se|tClip(re|
|00004f40| 67 69 6f 6e 29 3b 09 09 | 09 09 09 7b 72 65 73 74 |gion);..|...{rest|
|00004f50| 6f 72 65 20 74 68 65 20 | 6f 6c 64 20 63 6c 69 70 |ore the |old clip|
|00004f60| 7d 0d 09 44 69 73 70 6f | 73 65 52 67 6e 28 72 65 |}..Dispo|seRgn(re|
|00004f70| 67 69 6f 6e 29 3b 0d 45 | 4e 44 3b 20 7b 50 61 73 |gion);.E|ND; {Pas|
|00004f80| 63 61 6c 43 6c 69 6b 4c | 6f 6f 70 7d 0d 7b 24 50 |calClikL|oop}.{$P|
|00004f90| 4f 50 7d 0d 0d 0d 7b 24 | 53 20 4d 61 69 6e 7d 0d |OP}...{$|S Main}.|
|00004fa0| 7b 24 50 55 53 48 7d 20 | 7b 24 5a 2b 7d 0d 46 55 |{$PUSH} |{$Z+}.FU|
|00004fb0| 4e 43 54 49 4f 4e 20 47 | 65 74 4f 6c 64 43 6c 69 |NCTION G|etOldCli|
|00004fc0| 6b 4c 6f 6f 70 20 3a 20 | 50 72 6f 63 50 74 72 3b |kLoop : |ProcPtr;|
|00004fd0| 0d 0d 7b 47 65 74 73 20 | 63 61 6c 6c 65 64 20 66 |..{Gets |called f|
|00004fe0| 72 6f 6d 20 6f 75 72 20 | 61 73 73 65 6d 62 6c 79 |rom our |assembly|
|00004ff0| 20 6c 61 6e 67 75 61 67 | 65 20 72 6f 75 74 69 6e | languag|e routin|
|00005000| 65 2c 20 41 73 6d 43 6c | 69 6b 4c 6f 6f 70 2c 20 |e, AsmCl|ikLoop, |
|00005010| 77 68 69 63 68 20 69 73 | 20 69 6e 0d 74 75 72 6e |which is| in.turn|
|00005020| 20 63 61 6c 6c 65 64 20 | 62 79 20 74 68 65 20 54 | called |by the T|
|00005030| 45 43 6c 69 63 6b 20 74 | 6f 6f 6c 62 6f 78 20 72 |EClick t|oolbox r|
|00005040| 6f 75 74 69 6e 65 2e 20 | 49 74 20 72 65 74 75 72 |outine. |It retur|
|00005050| 6e 73 20 74 68 65 20 61 | 64 64 72 65 73 73 20 6f |ns the a|ddress o|
|00005060| 66 20 74 68 65 0d 64 65 | 66 61 75 6c 74 20 63 6c |f the.de|fault cl|
|00005070| 69 6b 4c 6f 6f 70 20 72 | 6f 75 74 69 6e 65 20 74 |ikLoop r|outine t|
|00005080| 68 61 74 20 77 61 73 20 | 70 75 74 20 69 6e 74 6f |hat was |put into|
|00005090| 20 74 68 65 20 54 45 52 | 65 63 20 62 79 20 54 45 | the TER|ec by TE|
|000050a0| 41 75 74 6f 56 69 65 77 | 20 74 6f 0d 41 73 6d 43 |AutoView| to.AsmC|
|000050b0| 6c 69 6b 4c 6f 6f 70 20 | 73 6f 20 74 68 61 74 20 |likLoop |so that |
|000050c0| 69 74 20 63 61 6e 20 63 | 61 6c 6c 20 69 74 2e 7d |it can c|all it.}|
|000050d0| 0d 0d 42 45 47 49 4e 0d | 09 47 65 74 4f 6c 64 43 |..BEGIN.|.GetOldC|
|000050e0| 6c 69 6b 4c 6f 6f 70 20 | 3a 3d 20 44 6f 63 75 6d |likLoop |:= Docum|
|000050f0| 65 6e 74 50 65 65 6b 28 | 46 72 6f 6e 74 57 69 6e |entPeek(|FrontWin|
|00005100| 64 6f 77 29 5e 2e 64 6f | 63 43 6c 69 6b 3b 0d 45 |dow)^.do|cClik;.E|
|00005110| 4e 44 3b 20 7b 47 65 74 | 4f 6c 64 43 6c 69 6b 4c |ND; {Get|OldClikL|
|00005120| 6f 6f 70 7d 0d 7b 24 50 | 4f 50 7d 0d 0d 0d 50 52 |oop}.{$P|OP}...PR|
|00005130| 4f 43 45 44 55 52 45 20 | 41 73 6d 43 6c 69 6b 4c |OCEDURE |AsmClikL|
|00005140| 6f 6f 70 3b 20 45 58 54 | 45 52 4e 41 4c 3b 0d 0d |oop; EXT|ERNAL;..|
|00005150| 7b 41 20 72 65 66 65 72 | 65 6e 63 65 20 74 6f 20 |{A refer|ence to |
|00005160| 6f 75 72 20 61 73 73 65 | 6d 62 6c 79 20 6c 61 6e |our asse|mbly lan|
|00005170| 67 75 61 67 65 20 72 6f | 75 74 69 6e 65 20 74 68 |guage ro|utine th|
|00005180| 61 74 20 67 65 74 73 20 | 61 74 74 61 63 68 65 64 |at gets |attached|
|00005190| 20 74 6f 20 74 68 65 20 | 63 6c 69 6b 4c 6f 6f 70 | to the |clikLoop|
|000051a0| 0d 66 69 65 6c 64 20 6f | 66 20 6f 75 72 20 54 45 |.field o|f our TE|
|000051b0| 20 72 65 63 6f 72 64 2e | 7d 0d 0d 0d 7b 24 53 20 | record.|}...{$S |
|000051c0| 4d 61 69 6e 7d 0d 50 52 | 4f 43 45 44 55 52 45 20 |Main}.PR|OCEDURE |
|000051d0| 44 6f 4e 65 77 3b 0d 0d | 7b 43 72 65 61 74 65 20 |DoNew;..|{Create |
|000051e0| 61 20 6e 65 77 20 64 6f | 63 75 6d 65 6e 74 20 61 |a new do|cument a|
|000051f0| 6e 64 20 77 69 6e 64 6f | 77 2e 7d 0d 0d 56 41 52 |nd windo|w.}..VAR|
|00005200| 0d 09 67 6f 6f 64 2c 20 | 69 67 6e 6f 72 65 09 09 |..good, |ignore..|
|00005210| 3a 20 42 4f 4f 4c 45 41 | 4e 3b 0d 09 73 74 6f 72 |: BOOLEA|N;..stor|
|00005220| 61 67 65 09 09 09 09 3a | 20 50 74 72 3b 0d 09 77 |age....:| Ptr;..w|
|00005230| 69 6e 64 6f 77 09 09 09 | 09 3a 20 57 69 6e 64 6f |indow...|.: Windo|
|00005240| 77 50 74 72 3b 0d 09 64 | 65 73 74 52 65 63 74 2c |wPtr;..d|estRect,|
|00005250| 20 76 69 65 77 52 65 63 | 74 09 3a 20 52 65 63 74 | viewRec|t.: Rect|
|00005260| 3b 0d 0d 42 45 47 49 4e | 0d 09 73 74 6f 72 61 67 |;..BEGIN|..storag|
|00005270| 65 20 3a 3d 20 4e 65 77 | 50 74 72 28 53 49 5a 45 |e := New|Ptr(SIZE|
|00005280| 4f 46 28 44 6f 63 75 6d | 65 6e 74 52 65 63 6f 72 |OF(Docum|entRecor|
|00005290| 64 29 29 3b 0d 09 49 46 | 20 73 74 6f 72 61 67 65 |d));..IF| storage|
|000052a0| 20 3c 3e 20 4e 49 4c 20 | 54 48 45 4e 20 42 45 47 | <> NIL |THEN BEG|
|000052b0| 49 4e 0d 09 09 77 69 6e | 64 6f 77 20 3a 3d 20 47 |IN...win|dow := G|
|000052c0| 65 74 4e 65 77 57 69 6e | 64 6f 77 28 72 44 6f 63 |etNewWin|dow(rDoc|
|000052d0| 57 69 6e 64 6f 77 2c 20 | 73 74 6f 72 61 67 65 2c |Window, |storage,|
|000052e0| 20 57 69 6e 64 6f 77 50 | 74 72 28 2d 31 29 29 3b | WindowP|tr(-1));|
|000052f0| 0d 09 09 49 46 20 77 69 | 6e 64 6f 77 20 3c 3e 20 |...IF wi|ndow <> |
|00005300| 4e 49 4c 20 54 48 45 4e | 20 42 45 47 49 4e 0d 09 |NIL THEN| BEGIN..|
|00005310| 09 09 67 4e 75 6d 44 6f | 63 75 6d 65 6e 74 73 20 |..gNumDo|cuments |
|00005320| 3a 3d 20 67 4e 75 6d 44 | 6f 63 75 6d 65 6e 74 73 |:= gNumD|ocuments|
|00005330| 20 2b 20 31 3b 09 7b 74 | 68 69 73 20 77 69 6c 6c | + 1;.{t|his will|
|00005340| 20 62 65 20 64 65 63 72 | 65 6d 65 6e 74 65 64 20 | be decr|emented |
|00005350| 77 68 65 6e 20 77 65 20 | 63 61 6c 6c 20 44 6f 43 |when we |call DoC|
|00005360| 6c 6f 73 65 57 69 6e 64 | 6f 77 7d 0d 09 09 09 67 |loseWind|ow}....g|
|00005370| 6f 6f 64 20 3a 3d 20 46 | 41 4c 53 45 3b 0d 09 09 |ood := F|ALSE;...|
|00005380| 09 53 65 74 50 6f 72 74 | 28 77 69 6e 64 6f 77 29 |.SetPort|(window)|
|00005390| 3b 0d 09 09 09 57 49 54 | 48 20 77 69 6e 64 6f 77 |;....WIT|H window|
|000053a0| 5e 2c 20 44 6f 63 75 6d | 65 6e 74 50 65 65 6b 28 |^, Docum|entPeek(|
|000053b0| 77 69 6e 64 6f 77 29 5e | 20 44 4f 20 42 45 47 49 |window)^| DO BEGI|
|000053c0| 4e 0d 09 09 09 09 47 65 | 74 54 45 52 65 63 74 28 |N.....Ge|tTERect(|
|000053d0| 77 69 6e 64 6f 77 2c 20 | 76 69 65 77 52 65 63 74 |window, |viewRect|
|000053e0| 29 3b 0d 09 09 09 09 64 | 65 73 74 52 65 63 74 20 |);.....d|estRect |
|000053f0| 3a 3d 20 76 69 65 77 52 | 65 63 74 3b 0d 09 09 09 |:= viewR|ect;....|
|00005400| 09 64 65 73 74 52 65 63 | 74 2e 72 69 67 68 74 20 |.destRec|t.right |
|00005410| 3a 3d 20 64 65 73 74 52 | 65 63 74 2e 6c 65 66 74 |:= destR|ect.left|
|00005420| 20 2b 20 6b 4d 61 78 44 | 6f 63 57 69 64 74 68 3b | + kMaxD|ocWidth;|
|00005430| 0d 09 09 09 09 64 6f 63 | 54 45 20 3a 3d 20 54 45 |.....doc|TE := TE|
|00005440| 4e 65 77 28 64 65 73 74 | 52 65 63 74 2c 20 76 69 |New(dest|Rect, vi|
|00005450| 65 77 52 65 63 74 29 3b | 0d 09 09 09 09 49 46 20 |ewRect);|.....IF |
|00005460| 64 6f 63 54 45 20 3c 3e | 20 4e 49 4c 20 54 48 45 |docTE <>| NIL THE|
|00005470| 4e 20 42 45 47 49 4e 09 | 09 7b 31 2e 30 32 20 2d |N BEGIN.|.{1.02 -|
|00005480| 20 6d 6f 76 65 64 7d 0d | 09 09 09 09 09 67 6f 6f | moved}.|.....goo|
|00005490| 64 20 3a 3d 20 54 52 55 | 45 3b 09 09 09 09 7b 69 |d := TRU|E;....{i|
|000054a0| 66 20 54 45 4e 65 77 20 | 73 75 63 63 65 65 64 65 |f TENew |succeede|
|000054b0| 64 2c 20 77 65 20 68 61 | 76 65 20 61 20 67 6f 6f |d, we ha|ve a goo|
|000054c0| 64 20 64 6f 63 75 6d 65 | 6e 74 7d 0d 09 09 09 09 |d docume|nt}.....|
|000054d0| 09 41 64 6a 75 73 74 56 | 69 65 77 52 65 63 74 28 |.AdjustV|iewRect(|
|000054e0| 64 6f 63 54 45 29 3b 0d | 09 09 09 09 09 54 45 41 |docTE);.|.....TEA|
|000054f0| 75 74 6f 56 69 65 77 28 | 54 52 55 45 2c 20 64 6f |utoView(|TRUE, do|
|00005500| 63 54 45 29 3b 0d 09 09 | 09 09 09 64 6f 63 43 6c |cTE);...|...docCl|
|00005510| 69 6b 20 3a 3d 20 64 6f | 63 54 45 5e 5e 2e 63 6c |ik := do|cTE^^.cl|
|00005520| 69 6b 4c 6f 6f 70 3b 0d | 09 09 09 09 09 64 6f 63 |ikLoop;.|.....doc|
|00005530| 54 45 5e 5e 2e 63 6c 69 | 6b 4c 6f 6f 70 20 3a 3d |TE^^.cli|kLoop :=|
|00005540| 20 40 41 73 6d 43 6c 69 | 6b 4c 6f 6f 70 3b 0d 09 | @AsmCli|kLoop;..|
|00005550| 09 09 09 45 4e 44 3b 0d | 09 09 09 09 49 46 20 67 |...END;.|....IF g|
|00005560| 6f 6f 64 20 54 48 45 4e | 20 42 45 47 49 4e 0d 09 |ood THEN| BEGIN..|
|00005570| 09 09 09 09 64 6f 63 56 | 53 63 72 6f 6c 6c 20 3a |....docV|Scroll :|
|00005580| 3d 20 47 65 74 4e 65 77 | 43 6f 6e 74 72 6f 6c 28 |= GetNew|Control(|
|00005590| 72 56 53 63 72 6f 6c 6c | 2c 20 77 69 6e 64 6f 77 |rVScroll|, window|
|000055a0| 29 3b 0d 09 09 09 09 09 | 67 6f 6f 64 20 3a 3d 20 |);......|good := |
|000055b0| 28 64 6f 63 56 53 63 72 | 6f 6c 6c 20 3c 3e 20 4e |(docVScr|oll <> N|
|000055c0| 49 4c 29 3b 0d 09 09 09 | 09 45 4e 44 3b 0d 09 09 |IL);....|.END;...|
|000055d0| 09 09 49 46 20 67 6f 6f | 64 20 54 48 45 4e 20 42 |..IF goo|d THEN B|
|000055e0| 45 47 49 4e 0d 09 09 09 | 09 09 64 6f 63 48 53 63 |EGIN....|..docHSc|
|000055f0| 72 6f 6c 6c 20 3a 3d 20 | 47 65 74 4e 65 77 43 6f |roll := |GetNewCo|
|00005600| 6e 74 72 6f 6c 28 72 48 | 53 63 72 6f 6c 6c 2c 20 |ntrol(rH|Scroll, |
|00005610| 77 69 6e 64 6f 77 29 3b | 0d 09 09 09 09 09 67 6f |window);|......go|
|00005620| 6f 64 20 3a 3d 20 28 64 | 6f 63 48 53 63 72 6f 6c |od := (d|ocHScrol|
|00005630| 6c 20 3c 3e 20 4e 49 4c | 29 3b 0d 09 09 09 09 45 |l <> NIL|);.....E|
|00005640| 4e 44 3b 0d 09 09 09 09 | 49 46 20 67 6f 6f 64 20 |ND;.....|IF good |
|00005650| 54 48 45 4e 20 42 45 47 | 49 4e 0d 09 09 09 09 09 |THEN BEG|IN......|
|00005660| 7b 46 41 4c 53 45 20 74 | 6f 20 41 64 6a 75 73 74 |{FALSE t|o Adjust|
|00005670| 53 63 72 6f 6c 6c 56 61 | 6c 75 65 73 20 6d 65 61 |ScrollVa|lues mea|
|00005680| 6e 73 20 6d 75 73 6e d5 | 74 20 72 65 64 72 61 77 |ns musn.|t redraw|
|00005690| 3b 20 74 65 63 68 6e 69 | 63 61 6c 6c 79 2c 20 6f |; techni|cally, o|
|000056a0| 66 20 63 6f 75 72 73 65 | 2c 0d 09 09 09 09 09 74 |f course|,......t|
|000056b0| 68 65 20 77 69 6e 64 6f | 77 20 69 73 20 68 69 64 |he windo|w is hid|
|000056c0| 64 65 6e 20 73 6f 20 69 | 74 20 77 6f 75 6c 64 6e |den so i|t wouldn|
|000056d0| d5 74 20 6d 61 74 74 65 | 72 20 77 68 65 74 68 65 |.t matte|r whethe|
|000056e0| 72 20 77 65 20 63 61 6c | 6c 65 64 20 53 68 6f 77 |r we cal|led Show|
|000056f0| 43 6f 6e 74 72 6f 6c 20 | 6f 72 20 6e 6f 74 2e 7d |Control |or not.}|
|00005700| 0d 09 09 09 09 09 41 64 | 6a 75 73 74 53 63 72 6f |......Ad|justScro|
|00005710| 6c 6c 56 61 6c 75 65 73 | 28 77 69 6e 64 6f 77 2c |llValues|(window,|
|00005720| 20 46 41 4c 53 45 29 3b | 0d 09 09 09 09 09 53 68 | FALSE);|......Sh|
|00005730| 6f 77 57 69 6e 64 6f 77 | 28 77 69 6e 64 6f 77 29 |owWindow|(window)|
|00005740| 3b 09 09 09 7b 69 66 20 | 74 68 65 20 64 6f 63 75 |;...{if |the docu|
|00005750| 6d 65 6e 74 20 69 73 20 | 67 6f 6f 64 2c 20 6d 61 |ment is |good, ma|
|00005760| 6b 65 20 74 68 65 20 77 | 69 6e 64 6f 77 20 76 69 |ke the w|indow vi|
|00005770| 73 69 62 6c 65 7d 0d 09 | 09 09 09 45 4e 44 20 45 |sible}..|...END E|
|00005780| 4c 53 45 20 42 45 47 49 | 4e 0d 09 09 09 09 09 69 |LSE BEGI|N......i|
|00005790| 67 6e 6f 72 65 20 3a 3d | 20 44 6f 43 6c 6f 73 65 |gnore :=| DoClose|
|000057a0| 57 69 6e 64 6f 77 28 77 | 69 6e 64 6f 77 29 3b 09 |Window(w|indow);.|
|000057b0| 7b 6f 74 68 65 72 77 69 | 73 65 20 72 65 67 72 65 |{otherwi|se regre|
|000057c0| 74 20 77 65 20 65 76 65 | 72 20 63 72 65 61 74 65 |t we eve|r create|
|000057d0| 64 20 69 74 2e 2e 2e 7d | 0d 09 09 09 09 09 41 6c |d it...}|......Al|
|000057e0| 65 72 74 55 73 65 72 28 | 65 4e 6f 57 69 6e 64 6f |ertUser(|eNoWindo|
|000057f0| 77 29 3b 09 09 09 09 7b | 61 6e 64 20 74 65 6c 6c |w);....{|and tell|
|00005800| 20 75 73 65 72 7d 0d 09 | 09 09 09 45 4e 44 0d 09 | user}..|...END..|
|00005810| 09 09 45 4e 44 3b 0d 09 | 09 45 4e 44 20 45 4c 53 |..END;..|.END ELS|
|00005820| 45 0d 09 09 09 44 69 73 | 70 6f 73 50 74 72 28 73 |E....Dis|posPtr(s|
|00005830| 74 6f 72 61 67 65 29 3b | 09 09 09 09 09 7b 67 65 |torage);|.....{ge|
|00005840| 74 20 72 69 64 20 6f 66 | 20 74 68 65 20 73 74 6f |t rid of| the sto|
|00005850| 72 61 67 65 20 69 66 20 | 69 74 20 69 73 20 6e 65 |rage if |it is ne|
|00005860| 76 65 72 20 75 73 65 64 | 7d 0d 09 45 4e 44 3b 0d |ver used|}..END;.|
|00005870| 45 4e 44 3b 20 7b 44 6f | 4e 65 77 7d 0d 0d 0d 7b |END; {Do|New}...{|
|00005880| 24 53 20 4d 61 69 6e 7d | 0d 50 52 4f 43 45 44 55 |$S Main}|.PROCEDU|
|00005890| 52 45 20 42 69 67 42 61 | 64 45 72 72 6f 72 28 65 |RE BigBa|dError(e|
|000058a0| 72 72 6f 72 3a 20 49 4e | 54 45 47 45 52 29 3b 0d |rror: IN|TEGER);.|
|000058b0| 42 45 47 49 4e 0d 09 41 | 6c 65 72 74 55 73 65 72 |BEGIN..A|lertUser|
|000058c0| 28 65 72 72 6f 72 29 3b | 0d 09 45 78 69 74 54 6f |(error);|..ExitTo|
|000058d0| 53 68 65 6c 6c 3b 0d 45 | 4e 44 3b 0d 0d 0d 7b 24 |Shell;.E|ND;...{$|
|000058e0| 53 20 49 6e 69 74 69 61 | 6c 69 7a 65 7d 0d 50 52 |S Initia|lize}.PR|
|000058f0| 4f 43 45 44 55 52 45 20 | 49 6e 69 74 69 61 6c 69 |OCEDURE |Initiali|
|00005900| 7a 65 3b 0d 0d 7b 53 65 | 74 20 75 70 20 74 68 65 |ze;..{Se|t up the|
|00005910| 20 77 68 6f 6c 65 20 77 | 6f 72 6c 64 2c 20 69 6e | whole w|orld, in|
|00005920| 63 6c 75 64 69 6e 67 20 | 67 6c 6f 62 61 6c 20 76 |cluding |global v|
|00005930| 61 72 69 61 62 6c 65 73 | 2c 20 54 6f 6f 6c 62 6f |ariables|, Toolbo|
|00005940| 78 20 6d 61 6e 61 67 65 | 72 73 2c 0d 20 6d 65 6e |x manage|rs,. men|
|00005950| 75 73 2c 20 61 6e 64 20 | 61 20 73 69 6e 67 6c 65 |us, and |a single|
|00005960| 20 62 6c 61 6e 6b 20 64 | 6f 63 75 6d 65 6e 74 2e | blank d|ocument.|
|00005970| 7d 0d 0d 7b 31 2e 30 31 | 20 2d 20 54 68 65 20 63 |}..{1.01| - The c|
|00005980| 6f 64 65 20 74 68 61 74 | 20 75 73 65 64 20 74 6f |ode that| used to|
|00005990| 20 62 65 20 70 61 72 74 | 20 6f 66 20 46 6f 72 63 | be part| of Forc|
|000059a0| 65 45 6e 76 69 72 6f 6e | 73 20 68 61 73 20 62 65 |eEnviron|s has be|
|000059b0| 65 6e 20 6d 6f 76 65 64 | 20 69 6e 74 6f 0d 20 74 |en moved| into. t|
|000059c0| 68 69 73 20 6d 6f 64 75 | 6c 65 2e 20 49 66 20 61 |his modu|le. If a|
|000059d0| 6e 20 65 72 72 6f 72 20 | 69 73 20 64 65 74 65 63 |n error |is detec|
|000059e0| 74 65 64 2c 20 69 6e 73 | 74 65 61 64 20 6f 66 20 |ted, ins|tead of |
|000059f0| 6d 65 72 65 6c 79 20 64 | 6f 69 6e 67 20 61 6e 20 |merely d|oing an |
|00005a00| 45 78 69 74 54 6f 53 68 | 65 6c 6c 2c 0d 20 77 68 |ExitToSh|ell,. wh|
|00005a10| 69 63 68 20 6c 65 61 76 | 65 73 20 74 68 65 20 75 |ich leav|es the u|
|00005a20| 73 65 72 20 77 69 74 68 | 6f 75 74 20 6d 75 63 68 |ser with|out much|
|00005a30| 20 74 6f 20 67 6f 20 6f | 6e 2c 20 77 65 20 63 61 | to go o|n, we ca|
|00005a40| 6c 6c 20 41 6c 65 72 74 | 55 73 65 72 2c 20 77 68 |ll Alert|User, wh|
|00005a50| 69 63 68 20 70 75 74 73 | 0d 20 75 70 20 61 20 73 |ich puts|. up a s|
|00005a60| 69 6d 70 6c 65 20 61 6c | 65 72 74 20 74 68 61 74 |imple al|ert that|
|00005a70| 20 6a 75 73 74 20 73 61 | 79 73 20 61 6e 20 65 72 | just sa|ys an er|
|00005a80| 72 6f 72 20 6f 63 63 75 | 72 72 65 64 20 61 6e 64 |ror occu|rred and|
|00005a90| 20 74 68 65 6e 20 63 61 | 6c 6c 73 20 45 78 69 74 | then ca|lls Exit|
|00005aa0| 54 6f 53 68 65 6c 6c 2e | 0d 20 53 69 6e 63 65 20 |ToShell.|. Since |
|00005ab0| 74 68 65 72 65 20 69 73 | 20 6e 6f 20 6f 74 68 65 |there is| no othe|
|00005ac0| 72 20 63 6c 65 61 6e 75 | 70 20 6e 65 65 64 65 64 |r cleanu|p needed|
|00005ad0| 20 61 74 20 74 68 69 73 | 20 70 6f 69 6e 74 20 69 | at this| point i|
|00005ae0| 66 20 61 6e 20 65 72 72 | 6f 72 20 69 73 20 64 65 |f an err|or is de|
|00005af0| 74 65 63 74 65 64 2c 0d | 20 74 68 69 73 20 66 6f |tected,.| this fo|
|00005b00| 72 6d 20 6f 66 20 65 72 | 72 6f 72 2d 20 68 61 6e |rm of er|ror- han|
|00005b10| 64 6c 69 6e 67 20 69 73 | 20 61 63 63 65 70 74 61 |dling is| accepta|
|00005b20| 62 6c 65 2e 20 49 66 20 | 6d 6f 72 65 20 73 6f 70 |ble. If |more sop|
|00005b30| 68 69 73 74 69 63 61 74 | 65 64 20 65 72 72 6f 72 |histicat|ed error|
|00005b40| 20 72 65 63 6f 76 65 72 | 79 0d 20 69 73 20 6e 65 | recover|y. is ne|
|00005b50| 65 64 65 64 2c 20 61 6e | 20 65 78 63 65 70 74 69 |eded, an| excepti|
|00005b60| 6f 6e 20 6d 65 63 68 61 | 6e 69 73 6d 2c 20 73 75 |on mecha|nism, su|
|00005b70| 63 68 20 61 73 20 69 73 | 20 70 72 6f 76 69 64 65 |ch as is| provide|
|00005b80| 64 20 62 79 20 53 69 67 | 6e 61 6c 73 2c 20 63 61 |d by Sig|nals, ca|
|00005b90| 6e 20 62 65 20 75 73 65 | 64 2e 7d 0d 0d 56 41 52 |n be use|d.}..VAR|
|00005ba0| 0d 09 6d 65 6e 75 42 61 | 72 09 09 09 09 3a 20 48 |..menuBa|r....: H|
|00005bb0| 61 6e 64 6c 65 3b 0d 09 | 74 6f 74 61 6c 2c 20 63 |andle;..|total, c|
|00005bc0| 6f 6e 74 69 67 09 09 3a | 20 4c 6f 6e 67 49 6e 74 |ontig..:| LongInt|
|00005bd0| 3b 0d 09 69 67 6e 6f 72 | 65 52 65 73 75 6c 74 09 |;..ignor|eResult.|
|00005be0| 09 3a 20 42 4f 4f 4c 45 | 41 4e 3b 0d 09 65 76 65 |.: BOOLE|AN;..eve|
|00005bf0| 6e 74 09 09 09 09 3a 20 | 45 76 65 6e 74 52 65 63 |nt....: |EventRec|
|00005c00| 6f 72 64 3b 0d 09 63 6f | 75 6e 74 2c 20 69 67 6e |ord;..co|unt, ign|
|00005c10| 6f 72 65 45 72 72 6f 72 | 09 3a 20 49 4e 54 45 47 |oreError|.: INTEG|
|00005c20| 45 52 3b 0d 09 0d 09 50 | 52 4f 43 45 44 55 52 45 |ER;....P|ROCEDURE|
|00005c30| 20 42 69 67 42 61 64 45 | 72 72 6f 72 28 65 72 72 | BigBadE|rror(err|
|00005c40| 6f 72 3a 20 49 4e 54 45 | 47 45 52 29 3b 0d 09 42 |or: INTE|GER);..B|
|00005c50| 45 47 49 4e 0d 09 09 41 | 6c 65 72 74 55 73 65 72 |EGIN...A|lertUser|
|00005c60| 28 65 72 72 6f 72 29 3b | 0d 09 09 45 78 69 74 54 |(error);|...ExitT|
|00005c70| 6f 53 68 65 6c 6c 3b 0d | 09 45 4e 44 3b 0d 0d 42 |oShell;.|.END;..B|
|00005c80| 45 47 49 4e 0d 09 67 49 | 6e 42 61 63 6b 67 72 6f |EGIN..gI|nBackgro|
|00005c90| 75 6e 64 20 3a 3d 20 46 | 41 4c 53 45 3b 0d 0d 09 |und := F|ALSE;...|
|00005ca0| 49 6e 69 74 47 72 61 66 | 28 40 74 68 65 50 6f 72 |InitGraf|(@thePor|
|00005cb0| 74 29 3b 0d 09 49 6e 69 | 74 46 6f 6e 74 73 3b 0d |t);..Ini|tFonts;.|
|00005cc0| 09 49 6e 69 74 57 69 6e | 64 6f 77 73 3b 0d 09 49 |.InitWin|dows;..I|
|00005cd0| 6e 69 74 4d 65 6e 75 73 | 3b 0d 09 54 45 49 6e 69 |nitMenus|;..TEIni|
|00005ce0| 74 3b 0d 09 49 6e 69 74 | 44 69 61 6c 6f 67 73 28 |t;..Init|Dialogs(|
|00005cf0| 4e 49 4c 29 3b 0d 09 49 | 6e 69 74 43 75 72 73 6f |NIL);..I|nitCurso|
|00005d00| 72 3b 0d 0d 09 7b 43 61 | 6c 6c 20 4d 50 50 4f 70 |r;...{Ca|ll MPPOp|
|00005d10| 65 6e 20 61 6e 64 20 41 | 54 50 4c 6f 61 64 20 61 |en and A|TPLoad a|
|00005d20| 74 20 74 68 69 73 20 70 | 6f 69 6e 74 20 74 6f 20 |t this p|oint to |
|00005d30| 69 6e 69 74 69 61 6c 69 | 7a 65 20 41 70 70 6c 65 |initiali|ze Apple|
|00005d40| 54 61 6c 6b 2c 0d 09 20 | 69 66 20 79 6f 75 20 61 |Talk,.. |if you a|
|00005d50| 72 65 20 75 73 69 6e 67 | 20 69 74 2e 7d 0d 09 7b |re using| it.}..{|
|00005d60| 4e 4f 54 45 20 2d 2d 20 | 49 74 20 69 73 20 6e 6f |NOTE -- |It is no|
|00005d70| 20 6c 6f 6e 67 65 72 20 | 6e 65 63 65 73 73 61 72 | longer |necessar|
|00005d80| 79 2c 20 61 6e 64 20 61 | 63 74 75 61 6c 6c 79 20 |y, and a|ctually |
|00005d90| 75 6e 68 65 61 6c 74 68 | 79 2c 20 74 6f 20 63 68 |unhealth|y, to ch|
|00005da0| 65 63 6b 0d 09 20 50 6f | 72 74 42 55 73 65 20 61 |eck.. Po|rtBUse a|
|00005db0| 6e 64 20 53 50 43 6f 6e | 66 69 67 20 62 65 66 6f |nd SPCon|fig befo|
|00005dc0| 72 65 20 6f 70 65 6e 69 | 6e 67 20 41 70 70 6c 65 |re openi|ng Apple|
|00005dd0| 54 61 6c 6b 2e 20 54 68 | 65 20 64 72 69 76 65 72 |Talk. Th|e driver|
|00005de0| 73 20 61 72 65 20 63 61 | 70 61 62 6c 65 0d 09 20 |s are ca|pable.. |
|00005df0| 6f 66 20 63 68 65 63 6b | 69 6e 67 20 66 6f 72 20 |of check|ing for |
|00005e00| 70 6f 72 74 20 61 76 61 | 69 6c 61 62 69 6c 69 74 |port ava|ilabilit|
|00005e10| 79 20 74 68 65 6d 73 65 | 6c 76 65 73 2e 7d 0d 09 |y themse|lves.}..|
|00005e20| 0d 09 7b 54 68 69 73 20 | 6e 65 78 74 20 62 69 74 |..{This |next bit|
|00005e30| 20 6f 66 20 63 6f 64 65 | 20 69 73 20 6e 65 63 65 | of code| is nece|
|00005e40| 73 73 61 72 79 20 74 6f | 20 61 6c 6c 6f 77 20 74 |ssary to| allow t|
|00005e50| 68 65 20 64 65 66 61 75 | 6c 74 20 62 75 74 74 6f |he defau|lt butto|
|00005e60| 6e 20 6f 66 20 6f 75 72 | 0d 09 20 61 6c 65 72 74 |n of our|.. alert|
|00005e70| 20 62 65 20 6f 75 74 6c | 69 6e 65 64 2e 0d 09 20 | be outl|ined... |
|00005e80| 31 2e 30 32 20 2d 20 43 | 68 61 6e 67 65 64 20 74 |1.02 - C|hanged t|
|00005e90| 6f 20 63 61 6c 6c 20 45 | 76 65 6e 74 41 76 61 69 |o call E|ventAvai|
|00005ea0| 6c 20 73 6f 20 74 68 61 | 74 20 77 65 20 64 6f 6e |l so tha|t we don|
|00005eb0| 27 74 20 6c 6f 73 65 20 | 73 6f 6d 65 20 69 6d 70 |'t lose |some imp|
|00005ec0| 6f 72 74 61 6e 74 0d 09 | 20 65 76 65 6e 74 73 2e |ortant..| events.|
|00005ed0| 7d 0d 09 20 0d 09 46 4f | 52 20 63 6f 75 6e 74 20 |}.. ..FO|R count |
|00005ee0| 3a 3d 20 31 20 54 4f 20 | 33 20 44 4f 0d 09 09 69 |:= 1 TO |3 DO...i|
|00005ef0| 67 6e 6f 72 65 52 65 73 | 75 6c 74 20 3a 3d 20 45 |gnoreRes|ult := E|
|00005f00| 76 65 6e 74 41 76 61 69 | 6c 28 65 76 65 72 79 45 |ventAvai|l(everyE|
|00005f10| 76 65 6e 74 2c 20 65 76 | 65 6e 74 29 3b 0d 09 0d |vent, ev|ent);...|
|00005f20| 09 7b 49 67 6e 6f 72 65 | 20 74 68 65 20 65 72 72 |.{Ignore| the err|
|00005f30| 6f 72 20 72 65 74 75 72 | 6e 65 64 20 66 72 6f 6d |or retur|ned from|
|00005f40| 20 53 79 73 45 6e 76 69 | 72 6f 6e 73 3b 20 65 76 | SysEnvi|rons; ev|
|00005f50| 65 6e 20 69 66 20 61 6e | 20 65 72 72 6f 72 20 6f |en if an| error o|
|00005f60| 63 63 75 72 72 65 64 2c | 0d 09 20 74 68 65 20 53 |ccurred,|.. the S|
|00005f70| 79 73 45 6e 76 69 72 6f | 6e 73 20 67 6c 75 65 20 |ysEnviro|ns glue |
|00005f80| 77 69 6c 6c 20 66 69 6c | 6c 20 69 6e 20 74 68 65 |will fil|l in the|
|00005f90| 20 53 79 73 45 6e 76 52 | 65 63 2e 20 59 6f 75 20 | SysEnvR|ec. You |
|00005fa0| 63 61 6e 20 73 61 76 65 | 20 61 20 72 65 64 75 6e |can save| a redun|
|00005fb0| 64 61 6e 74 0d 09 20 63 | 61 6c 6c 20 74 6f 20 53 |dant.. c|all to S|
|00005fc0| 79 73 45 6e 76 69 72 6f | 6e 73 20 62 79 20 63 61 |ysEnviro|ns by ca|
|00005fd0| 6c 6c 69 6e 67 20 69 74 | 20 61 66 74 65 72 20 69 |lling it| after i|
|00005fe0| 6e 69 74 69 61 6c 69 7a | 69 6e 67 20 41 70 70 6c |nitializ|ing Appl|
|00005ff0| 65 54 61 6c 6b 2e 7d 0d | 09 20 0d 09 69 67 6e 6f |eTalk.}.|. ..igno|
|00006000| 72 65 45 72 72 6f 72 20 | 3a 3d 20 53 79 73 45 6e |reError |:= SysEn|
|00006010| 76 69 72 6f 6e 73 28 6b | 53 79 73 45 6e 76 69 72 |virons(k|SysEnvir|
|00006020| 6f 6e 73 56 65 72 73 69 | 6f 6e 2c 20 67 4d 61 63 |onsVersi|on, gMac|
|00006030| 29 3b 0d 09 0d 09 7b 4d | 61 6b 65 20 73 75 72 65 |);....{M|ake sure|
|00006040| 20 74 68 61 74 20 74 68 | 65 20 6d 61 63 68 69 6e | that th|e machin|
|00006050| 65 20 68 61 73 20 61 74 | 20 6c 65 61 73 74 20 31 |e has at| least 1|
|00006060| 32 38 4b 20 52 4f 4d 73 | 2e 20 49 66 20 69 74 20 |28K ROMs|. If it |
|00006070| 64 6f 65 73 6e 27 74 2c | 20 65 78 69 74 2e 7d 0d |doesn't,| exit.}.|
|00006080| 09 0d 09 49 46 20 67 4d | 61 63 2e 6d 61 63 68 69 |...IF gM|ac.machi|
|00006090| 6e 65 54 79 70 65 20 3c | 20 30 20 54 48 45 4e 20 |neType <| 0 THEN |
|000060a0| 42 69 67 42 61 64 45 72 | 72 6f 72 28 65 57 72 6f |BigBadEr|ror(eWro|
|000060b0| 6e 67 4d 61 63 68 69 6e | 65 29 3b 0d 09 0d 09 7b |ngMachin|e);....{|
|000060c0| 31 2e 30 32 20 2d 20 4d | 6f 76 65 20 54 72 61 70 |1.02 - M|ove Trap|
|000060d0| 41 76 61 69 6c 61 62 6c | 65 20 63 61 6c 6c 20 74 |Availabl|e call t|
|000060e0| 6f 20 61 66 74 65 72 20 | 53 79 73 45 6e 76 69 72 |o after |SysEnvir|
|000060f0| 6f 6e 73 20 73 6f 20 74 | 68 61 74 20 77 65 20 63 |ons so t|hat we c|
|00006100| 61 6e 20 74 65 6c 6c 0d | 09 20 69 6e 20 54 72 61 |an tell.|. in Tra|
|00006110| 70 41 76 61 69 6c 61 62 | 6c 65 20 69 66 20 61 20 |pAvailab|le if a |
|00006120| 74 6f 6f 6c 20 74 72 61 | 70 20 76 61 6c 75 65 20 |tool tra|p value |
|00006130| 69 73 20 6f 75 74 20 6f | 66 20 72 61 6e 67 65 2e |is out o|f range.|
|00006140| 7d 0d 09 20 0d 09 67 48 | 61 73 57 61 69 74 4e 65 |}.. ..gH|asWaitNe|
|00006150| 78 74 45 76 65 6e 74 20 | 3a 3d 20 54 72 61 70 41 |xtEvent |:= TrapA|
|00006160| 76 61 69 6c 61 62 6c 65 | 28 5f 57 61 69 74 4e 65 |vailable|(_WaitNe|
|00006170| 78 74 45 76 65 6e 74 2c | 20 54 6f 6f 6c 54 72 61 |xtEvent,| ToolTra|
|00006180| 70 29 3b 0d 0d 09 7b 31 | 2e 30 31 20 2d 20 57 65 |p);...{1|.01 - We|
|00006190| 20 75 73 65 64 20 74 6f | 20 6d 61 6b 65 20 61 20 | used to| make a |
|000061a0| 63 68 65 63 6b 20 66 6f | 72 20 6d 65 6d 6f 72 79 |check fo|r memory|
|000061b0| 20 61 74 20 74 68 69 73 | 20 70 6f 69 6e 74 20 62 | at this| point b|
|000061c0| 79 20 65 78 61 6d 69 6e | 69 6e 67 20 41 70 70 6c |y examin|ing Appl|
|000061d0| 4c 69 6d 69 74 2c 0d 09 | 20 41 70 70 6c 69 63 5a |Limit,..| ApplicZ|
|000061e0| 6f 6e 65 2c 20 61 6e 64 | 20 53 74 61 63 6b 53 70 |one, and| StackSp|
|000061f0| 61 63 65 20 61 6e 64 20 | 63 6f 6d 70 61 72 69 6e |ace and |comparin|
|00006200| 67 20 74 68 61 74 20 74 | 6f 20 74 68 65 20 6d 69 |g that t|o the mi|
|00006210| 6e 69 6d 75 6d 20 73 69 | 7a 65 20 77 65 20 74 6f |nimum si|ze we to|
|00006220| 6c 64 0d 09 20 4d 75 6c | 74 69 46 69 6e 64 65 72 |ld.. Mul|tiFinder|
|00006230| 20 77 65 20 6e 65 65 64 | 65 64 2e 20 54 68 69 73 | we need|ed. This|
|00006240| 20 64 69 64 20 6e 6f 74 | 20 77 6f 72 6b 20 77 65 | did not| work we|
|00006250| 6c 6c 20 62 65 63 61 75 | 73 65 20 69 74 20 61 73 |ll becau|se it as|
|00006260| 73 75 6d 65 64 20 74 6f | 6f 20 6d 75 63 68 20 61 |sumed to|o much a|
|00006270| 62 6f 75 74 0d 09 20 74 | 68 65 20 72 65 6c 61 74 |bout.. t|he relat|
|00006280| 69 6f 6e 73 68 69 70 20 | 62 65 74 77 65 65 6e 20 |ionship |between |
|00006290| 77 68 61 74 20 77 65 20 | 61 73 6b 65 64 20 4d 75 |what we |asked Mu|
|000062a0| 6c 74 69 46 69 6e 64 65 | 72 20 66 6f 72 20 61 6e |ltiFinde|r for an|
|000062b0| 64 20 77 68 61 74 20 77 | 65 20 77 6f 75 6c 64 20 |d what w|e would |
|000062c0| 61 63 74 75 61 6c 6c 79 | 0d 09 20 67 65 74 20 62 |actually|.. get b|
|000062d0| 61 63 6b 2c 20 61 73 20 | 77 65 6c 6c 20 61 73 20 |ack, as |well as |
|000062e0| 68 6f 77 20 74 6f 20 6d | 65 61 73 75 72 65 20 69 |how to m|easure i|
|000062f0| 74 2e 20 49 6e 73 74 65 | 61 64 2c 20 77 65 20 77 |t. Inste|ad, we w|
|00006300| 69 6c 6c 20 75 73 65 20 | 61 6e 20 61 6c 74 65 72 |ill use |an alter|
|00006310| 6e 61 74 65 0d 09 20 6d | 65 74 68 6f 64 20 63 6f |nate.. m|ethod co|
|00006320| 6d 70 72 69 73 65 64 20 | 6f 66 20 74 77 6f 20 73 |mprised |of two s|
|00006330| 74 65 70 73 2e 7d 0d 09 | 20 0d 09 7b 49 74 20 69 |teps.}..| ..{It i|
|00006340| 73 20 62 65 74 74 65 72 | 20 74 6f 20 66 69 72 73 |s better| to firs|
|00006350| 74 20 63 68 65 63 6b 20 | 74 68 65 20 73 69 7a 65 |t check |the size|
|00006360| 20 6f 66 20 74 68 65 20 | 61 70 70 6c 69 63 61 74 | of the |applicat|
|00006370| 69 6f 6e 20 68 65 61 70 | 20 61 67 61 69 6e 73 74 |ion heap| against|
|00006380| 20 61 20 76 61 6c 75 65 | 0d 09 20 74 68 61 74 20 | a value|.. that |
|00006390| 79 6f 75 20 68 61 76 65 | 20 64 65 74 65 72 6d 69 |you have| determi|
|000063a0| 6e 65 64 20 69 73 20 74 | 68 65 20 73 6d 61 6c 6c |ned is t|he small|
|000063b0| 65 73 74 20 68 65 61 70 | 20 74 68 65 20 61 70 70 |est heap| the app|
|000063c0| 6c 69 63 61 74 69 6f 6e | 20 63 61 6e 20 72 65 61 |lication| can rea|
|000063d0| 73 6f 6e 61 62 6c 79 0d | 09 20 77 6f 72 6b 20 69 |sonably.|. work i|
|000063e0| 6e 2e 20 54 68 69 73 20 | 6e 75 6d 62 65 72 20 73 |n. This |number s|
|000063f0| 68 6f 75 6c 64 20 62 65 | 20 64 65 72 69 76 65 64 |hould be| derived|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.